-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
93 lines (89 loc) · 2.65 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="author" content="Lars Wagner" />
<meta name="description" content="First TODO-App" />
<title>My 1st TODO App with Vue</title>
<link rel="stylesheet" href="style.css" />
</head>
<body>
<main>
<article class="todo-article" id="app">
<h1>My Todo-App with Vue</h1>
<h2 class="claim">Getting things done…</h2>
<!-- <pre>
{{ $data }}
</pre> -->
<form id="task-form">
<label class="hidden" for="input-field">new task</label>
<input
type="text"
v-model="newTodoText"
name="input-field"
id="input"
placeholder="Start your list!"
autofocus
/>
<button id="add-btn" @click.prevent="addTodo()" type="submit">
add
</button>
<button id="clear-btn" @click="deleteDoneTodos">remove</button>
<div class="filter">
<label for="filter-all">
<input
type="radio"
name="filter"
id="filter-all"
value="all"
v-model="filter"
checked
/>
all
</label>
<label for="filter-open">
<input
type="radio"
name="filter"
id="filter-open"
value="open"
v-model="filter"
/>
open
</label>
<label for="filter-done">
<input
type="radio"
name="filter"
id="filter-done"
value="done"
v-model="filter"
/>
done
</label>
</div>
</form>
<ul class="task-list">
<li class="task-item" v-for="todo of filteredTodos" :key="todo.id">
<div class="checkbox-wrapper">
<input
type="checkbox"
name="item-1"
id="'item-' + todo.id"
:checked="todo.done"
@change="updateTodo(todo)"
/>
<label :for="'item-' + todo.id">{{ todo.description }}</label>
<button class="delete-task" @click="deleteTodo(todo.id)">
X
</button>
</div>
</li>
</ul>
</article>
</main>
<script src="https://unpkg.com/vue@latest"></script>
<script src="script.js"></script>
</body>
</html>