-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.html
34 lines (34 loc) · 990 Bytes
/
test.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
<!DOCTYPE html>
<html data-framework="vue">
<head>
<meta charset="utf-8" />
<title></title>
<script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.9/vue.js"></script>
</head>
<body>
<div id="app"></div>
<script>
new Vue({
data() {
return {
list: [1, 2, 3],
a: 0
}
},
methods: {
handleClick() {
// this.list.unshift(Math.random())
// this.a = Math.random()
this.list.push(Math.random())
}
},
template:`
<div @click="handleClick">
<div>{{a}}</div>
<div v-for="(item, index) in list" :key="index">{{item}}</div>
</div>
`
}).$mount('#app')
</script>
</body>
</html>