Files
ClassContent/历届学生/font-end-nine/项目练习/学生项目/冯文焌/8vue/1.html
2024-09-27 02:06:13 +08:00

56 lines
1.2 KiB
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>Document</title>
</head>
<body>
<div class="app">
<h2 ref="test">{{ test }}</h2>
</div>
</body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14"></script>
<script>
var vm = new Vue({
el: '.app',
data: {
test:'你好'
},
created() {
console.log(this.$refs.test);
},
mounted() {
this.getTest
console.log(this.getHello);
console.log(this.$refs.test);
},
updated(){
console.log("数据更新了");
},
methods:{
gttTest(){
console.log("gttTest");
}
},
computed:{
getHellow(){
console.log("getHellow");
return 1
}
},
watch:{
test(newVal, oldVal){
console.log("newVal: ", newVal);
console.log("oldVal: ", oldVal);
}
}
})
</script>
</html>