-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
77 lines (72 loc) · 3.14 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
70
71
72
73
74
75
76
77
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Vue + Vuex + ES Modules • TodoMVC</title>
<link rel="stylesheet" href="css/vendor/index.css">
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<section v-cloak class="todoapp" id="app">
<header-view></header-view>
<todo-list></todo-list>
<footer-view></footer-view>
</section>
<footer class="info">
<p>Double-click to edit a todo</p>
<p>Created by <a href="https://mattcampbell.net">Matt Campbell</a></p>
<p>Part of <a href="http://todomvc.com">TodoMVC</a></p>
</footer>
<script type="text/x-template" id="template-header">
<header class="header">
<h1>todos</h1>
<input class="new-todo" placeholder="What needs to be done?" autofocus v-model="todoInput" @keyup.enter="onSubmit">
</header>
</script>
<script type="text/x-template" id="template-todo-list">
<!-- This section should be hidden by default and shown when there are todos -->
<section class="main" v-if="todos.length > 0">
<input id="toggle-all" class="toggle-all" type="checkbox" @change="toggleAll" :checked="todos.length > 0 && todos.length === completeTodos.length">
<label for="toggle-all">Mark all as complete</label>
<ul class="todo-list">
<!-- List items should get the class `editing` when editing and `completed` when marked as completed -->
<li v-for="todo in visibleTodos" :key="todo.id" :class="{ completed: todo.complete, editing: editId === todo.id }">
<div class="view">
<input class="toggle" :data-id="todo.id" type="checkbox" :checked="todo.complete" @change="toggleComplete">
<label :data-id="todo.id" @dblclick="toggleEdit">{{ todo.text }}</label>
<button class="destroy" :data-id="todo.id" @click="deleteTodo"></button>
</div>
<input :id="`edit-todo-${todo.id}`" class="edit" :value="todo.text" @keyup.escape="cancelEdit" @keyup.enter="saveEdit" @blur="saveEdit">
</li>
</ul>
</section>
</script>
<script type="text/x-template" id="template-footer">
<!-- This footer should hidden by default and shown when there are todos -->
<footer class="footer" v-if="todos.length > 0">
<!-- This should be `0 items left` by default -->
<span class="todo-count"><strong>{{ activeTodos.length }}</strong> {{ activeTodos.length === 1 ? 'item' : 'items' }} left</span>
<ul class="filters">
<li>
<a :class="{ selected: filter === FilterType.ALL }" href="#/all">All</a>
</li>
<li>
<a :class="{ selected: filter === FilterType.ACTIVE }" href="#/active">Active</a>
</li>
<li>
<a :class="{ selected: filter === FilterType.COMPLETE }" href="#/completed">Completed</a>
</li>
</ul>
<!-- Hidden if no completed items are left ↓ -->
<button class="clear-completed" v-if="completeTodos.length > 0" @click="clearComplete">Clear completed</button>
</footer>
</script>
<script src="js/vendor/vue.js"></script>
<script src="js/vendor/vuex.js"></script>
<script>
Vue.config.devtools = true;
</script>
<script src="js/app.js" type="module"></script>
</body>
</html>