-
Notifications
You must be signed in to change notification settings - Fork 0
/
Shopping List.html
71 lines (62 loc) · 2.23 KB
/
Shopping List.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shopping App</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
<!-- development version, includes helpful console warnings -->
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<style>
</style>
</head>
<body>
<div id="app">
<div class="container">
<div class="row">
<div class="col-md-6">
<h3>Shopping List</h3>
<input v-model="newItem" name="newItem" value="" placeholder="Enter the new item" @keyup.enter="addItem">
<div class="from-list-control">
<ul>
<li class="form-list-control" v-for="item in items" v-model="item.checked":class="{removed: item.checked}">
<div>
<input class="form-check-input" type="checkbox" value="" v-model="item.checked">
<label >
{{item.text}}
</label>
</div>
</li>
</ul>
</br></br>
</div>
</div>
<div>
</div>
</div>
</div>
</div>
</body>
<script>
data:{
items:[
{text:"banana",checked:false},
{text:"apple",checked:false},
{text:"thakela",checked:false},
],
newItem:"",
},
methods:{
addItem = function(){
var text;
text = this.newItem.trim();
if(text){
this.items.push({text:this.newItem,checked:false});
this.newItem="";
}
}
},
});
</script>
</html>