-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
54 lines (51 loc) · 1.22 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Do one thing today.</title>
<meta name="viewport" content="initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<link rel="stylesheet" href="/assets/css/styles.css">
</head>
<body>
<header>
<h1>Do <span>one</span> thing today.</h1>
<p>Maybe three. Not more than seven.</p>
</header>
<main id="app">
<ol>
<li v-for="item in items" v-bind:class="{ 'checked': item.checked }">
<label>
<input type="checkbox" v-model="item.checked" /> {{ item.text }}
</label></li>
</ol>
<p><input v-show="items.length<7" v-model="newItem" v-on:keyup.enter="addItem" placeholder="add todo item" type="text"></p>
<p><button v-on:click="reset">clear list</button></p>
</main>
<script src="/assets/js/vendor/vue_2.2.4.js"></script>
<script>
var data = {
items: [],
newItem: ''
};
new Vue({
el: '#app',
data: data,
methods: {
addItem: function () {
var text = this.newItem.trim();
if (text) {
this.items.push({
text: text,
checked: false
});
this.newItem = '';
}
},
reset: function () {
this.items = [];
}
}
});
</script>
</body>
</html>