-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvue.html
executable file
·104 lines (90 loc) · 1.58 KB
/
vue.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script src="vue.js"></script>
</head>
<body>
<div id="app">
{{message}}
</div>
<div id="app-2">
<span v-bind:title="message">
dd
</span>
</div>
<div id="app-3">
<p v-if="seen">看到我了吗</p>
</div>
<div id="app-4">
<ol>
<li v-for="todo in todos">
{{ todo.text }}
</li>
</ol>
</div>
<div id="app-5">
<p>{{ message }}</p>
<button v-on:click="reverseMessage">逆转</button>
</div>
<div id="app-6">
<p>{{ message }}</p>
<input v-model="message">
</div>
<ol>
<todo-item></todo-item>
</ol>
<script>
Vue.component('todo-item', {
template: '<li>123</li>'
});
var app6 = new Vue({
el: '#app-6',
data: {
message: 'Hello Vue'
}
})
var app5 = new Vue({
el: '#app-5',
data: {
message: 'hellovuejs'
},
methods:{
reverseMessage: function() {
this.message = this.message.split('').reverse().join('')
}
}
})
var app = new Vue({
el: '#app',
data: {
message: 'Helloworld'
}
});
var app2 = new Vue({
el: '#app-2',
data: {
message: '页面加载于' + new Date().toLocaleString()
}
});
var app3 = new Vue({
el: '#app-3',
data: {
seen: true
}
});
var app4 = new Vue({
el: '#app-4',
data: {
todos: [
{text: '111'},
{text: '222'},
{text: '333'},
{text: '444'}
]
}
});
</script>
</body>
</html>