-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtodo.html
35 lines (33 loc) · 1016 Bytes
/
todo.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>To Do List</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script src="https://unpkg.com/vue@next"></script>
</head>
<body>
<div id="toDo">
<h1>To Do List</h1>
<form v-on:submit.prevent="addNewTask">
<label for="todo-input">Add a new task</label>
<input
id="todo-input"
placeholder="Task"
v-model="task">
<button type="submit">Submit</button>
</form>
<h1>Final List</h1>
<ol>
<todo-item v-for="(todo, key) in tasks"
:key="todo.id"
:title="todo.title"
@remove="tasks.splice(key, 1)">
</todo-item>
</ol>
</div>
<script src="todo.js"></script>
<script src="./components/ToDoComponent.js"></script>
<script>const mountedToDo = toDo.mount("#toDo")</script>
</body>
</html>