Files
ClassContent/历届学生/front-end-team/每天课程/2020-04-12/自定义指令.html
2024-09-27 02:06:13 +08:00

45 lines
908 B
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Vue 基础学习</title>
</head>
<body>
<div class="app">
<div v-demo="test">你好</div>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<script>
Vue.directive('demo', {
bind: function (el, binding, vnode) {
document.title = binding.value
console.log("el: ",el);
console.log("binding: ",binding);
console.log("vnode: ",vnode);
}
})
var vm = new Vue({
el: '.app',
data: {
test: '自定义指令学习',
},
methods: {
},
computed: {
},
watch: {
}
})
</script>
</html>