-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
105 lines (93 loc) · 2.17 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<!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" key="1" style="color:red;font-size:25px">
<my-button></my-button>
</div>
<script src="dist/vue.js"></script>
<!-- <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script> -->
<script>
Vue.component('my-button', {
template: `<button>{{bb}}</button>`,
data(){
return {
a:1
}
},
computed:{
bb(){
return this.a+1
}
}
})
// let a = new Vue()
// console.log('a:', a);
let vm = new Vue({
el: '#app',
data() {
return {
msg: 'hello',
ss: 'ssssss',
aa: 'aaaaa',
a: {
b: {
c: {
d: 1
}
}
},
arr: [1, 2, 3],
list: [{
a: {
m: 2
}
}]
}
},
created() {
},
updated() {
// console.log('updated');
},
computed: {
fullName() {
return { aa: this.aa, ss: this.ss }
}
},
watch: {
// msg(newValue, oldValue) {
// // console.log('newValue:', newValue);
// // console.log('oldValue:', oldValue);
// },
// 'a.b.c.d': {
// handler() {
// this.ss = 222
// console.log(this.ss)
// }
// },
// aa: {
// handler() {
// // console.log('111')
// },
// // immediate:true
// }
}
})
setTimeout(() => {
// vm.msg = '啊啊啊啊啊啊啊啊啊啊'
vm.ss = 222
// vm.a.b.c.d = 'dwdwdw'
// vm.list.push(1)
vm.$nextTick(() => {
})
}, 1000);
console.log('%c 🍎 vm: ', 'font-size:20px;background-color: #E41A6A;color:#fff;', vm);
</script>
</body>
</html>