-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
69 lines (59 loc) · 1.48 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue-single</title>
<script src="vue.js"></script>
<script src="todo.js"></script>
</head>
<body>
<div id="app">
<span v-el:username>someUser</span>
<br>
<span>{{message}}</span>
<br>
<input type="text" style="width:400px" v-model="message">
<p>
<button @click="changeMessage" type="button">changeMessage</button>
<button @click="changeName" type="button">changeName</button>
</p>
<div>
<h2>To Do</h2>
<input type="text" v-model="filterField" >
<todo-list :list-data="listData" :filter-value="filterField" @onEdit="editTodo" @onDelete="deleteTodo" ></todo-list>
</div>
</div>
</body>
<script>
// var todoList = Vue.component('todoList' , todoComponet);
var vm = new Vue({
el: '#app',
data: {
message: 'hello world',
filterField: '',
listData: [
{text: 'react 1', id: '1' },
{text: 'todo 2' , id: '2'},
{text: 'mand 3' , id: '3'},
{text: 'xname 4' , id: '4'},
{text: 'vue 5' , id: '5'},
]
},
methods: {
changeMessage(){
this.message = 'hello wrold' + Date.now();
},
changeName(){
this.$els.username.textContent = 'wang yong hua' + Date.now();
},
editTodo(){
},
deleteTodo(){
}
},
components: {
'todoList': todoComponet
}
});
</script>
</html>