-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (67 loc) · 2.66 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="https://bootswatch.com/4/lumen/bootstrap.min.css">
<style>
.doneTodo{
text-decoration: line-through;
}
.item-todo{
padding: 10px;
background-color:beige;
border-radius:10px;
margin-bottom:5px;
}
.todo-done{
padding: 10px;
opacity: 0.3;
background-color:beige;
border-radius:10px;
margin-bottom:5px;
}
.td-text{
word-wrap: break-word;
word-break: break-all;
white-space: normal;
font-weight: bold;
}
</style>
<title>Simple Todo VueJS</title>
</head>
<body>
<main id="app" class="p-2">
<h2 class="mt-3 text-center" style="width:100%;">{{titleTodo}}</h2>
<div class="d-flex justify-content-center" style="width:100%;">
<div style="width:70%;">
<form @submit.prevent="addTodo">
<input type="text" name="todo" class="form-control" id="todo" v-model="todo" placeholder="Walk the dogs, Wash the car.">
<span class="m-1 text-center text-warning">{{warnText}}</span>
<button type="submit" class="btn btn-primary mt-1 mb-3" style="width:100%;" >Add Todo</button>
</form>
<div>
<div v-for="itemTodo in arrTodo" :class="[itemTodo.isDone ? theDoneTodo : notTheDoneTodo]" >
<table width="100%">
<tr>
<td width="20%" class="text-center">
<button @click="doneTodo(itemTodo)" class="btn btn-success">Done</button>
</td>
<td width="60%" class="td-text pl-2">
<span :class="{doneTodo : itemTodo.isDone }">{{itemTodo.title}}</span>
</td>
<td width="20%" class="text-center">
<button @click="deleteTodo(itemTodo)" class="btn btn-warning">Delete</button>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script src="app.js"></script>
</body>
</html>