-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
48 lines (46 loc) · 1.31 KB
/
Copy pathindex.html
File metadata and controls
48 lines (46 loc) · 1.31 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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script crossorigin src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js"></script>
<title>
仮想dom sample
</title>
</head>
<body>
<script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
<div id="app"></div>
<div id="app2">
<button v-on:click="countup">vue</button>
<ul style="list-style-type: none">
<li v-for="item in countLis">{{ item }}</li>
</ul>
</div>
<script src="dist/index.js"></script>
<script>
new Vue({
el: '#app2',
data: {
count: 0,
countLis: []
},
methods: {
countup: function() {
if(this.count == 0){
this.count = 1;
this.countLis.push(this.count)
return
}
this.count = 0
this.countLis.push(this.count)
return
}
}
})
</script>
</body>
</html>