-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
52 lines (47 loc) · 1.19 KB
/
index.html
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
<!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 id="app" style="color:red;font-size:20px;">hello {{msg}}<h1>123</h1>
</div>
<script src="./dist/vue.js"></script>
<script>
Vue.Mixin({
created: function a () {
}
})
Vue.Mixin({
created: function b () {
}
})
// 响应式的数据变化
const vm = new Vue({
el: '#app',
data () {//代理数据
return {
name: 'czy',
msg: 'hello',
age: 20,
favorite: ['basketball', 'football'],
other: {
school: 'unkown',
level: 1
}
}
}
})
setTimeout(() => {
vm.msg = 'zhangshan'
// vm._update(vm._render()) //vm._render()获取到vm实力上的数据 vm._update更新页面
}, 1000)
// 问题自动更新
// 1.数据变化,自动更新视图 vm._update(vm._render())
// 2.vue中更新组建策略是:以组件单位,给每一组件添加一个watcher
</script>
</body>
</html>