-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhello.html
More file actions
63 lines (52 loc) · 1.34 KB
/
hello.html
File metadata and controls
63 lines (52 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script src="node_modules/vue/dist/vue.js"></script>
<div id="app">
<input type="text" v-model="num" /> <button @click="add">add</button> <br/>
<h1>{{name}} 非常帅。。。。。</h1><br>
有{{num}} 位女神为其着迷。。
</div>
<script>
const app = new Vue({
el:"#app",
data:{
name : "虎哥",
num:0,
},
methods:{
add:function () {
//this代表的当前vue实例
this.num ++
}
},
beforeCreated(){
console.log('beforeCreated....');
},
created(){
//向后台发起ajax请求
//this.name = "虎哥 真的"
//延迟一秒加载,模拟ajax请求。。。。。。
//setTimeout(() => this.name = "徐哥 真的",1000);
console.log('created.....');
},
beforeMount(){
console.log('beforeMount.....');
},
mounted(){
console.log('mounted...');
},
beforeUpdate(){
console.log('before Update...');
},
updated(){
console.log('updated...');
}
});
</script>
</body>
</html>