console
<!DOCTYPE html>
<html>
<head>
<title>My first Vue app</title>
</head>
<body>
<div id="app">
{{ message }}
<anchored-heading level="3">321321</anchored-heading>
<button @click="test">test</button>
</div>
<script>
Vue.component('anchored-heading', {
render: function (createElement) {
console.log(createElement)
return createElement(
'h' + this.level,
this.$slots.default
)
},
props: {
level: {
type: Number,
required: true
}
},
})
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
},
methods: {
test() {
console.log(123)
}
}
})
</script>
</body>
</html>