-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.html
More file actions
61 lines (54 loc) · 1.06 KB
/
test.html
File metadata and controls
61 lines (54 loc) · 1.06 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="map">
{{ message }}
<button @click="random()">{{ message }}</button>
<input v-model="message" placeholder="edit me">
<button-counter></button-counter>
</div>
<div id="map2">
{{ message }}
<button @click="random()">{{ message }}</button>
<input v-model="message" placeholder="edit me">
</div>
<script>
// Define a new component called button-counter
Vue.component('button-counter', {
data: function () {
return {
count: 0
}
},
template: '<button v-on:click="count++">You clicked me {{ count }} times.</button>'
})
var map = new Vue({
el: '#map',
data: {
message: 'Hello Vue!'
},
methods: {
random : function() {
this.message = new Date();
}
}
})
var map2 = new Vue({
el: '#map2',
data: {
message: 'Hello Vue!'
},
methods: {
random : function() {
this.message = new Date();
}
}
})
</script>
</body>
</html>