Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
z6wdc committed Mar 2, 2021
0 parents commit 88dd842
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>todo list</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.3/vue.min.js"></script>
</head>
<body>
<div id="app">
<div>
<input type="text" v-model="input"/>
<button v-on:click="add">Add</button>
</div>
<ul>
<li v-for="(item, index) in items" v-on:click="removeItem(index)">{{item}}</li>
</ul>
</div>
<script >
new Vue({
el: '#app',
data: {
input: '',
items: [
'clean something',
'2',
'3'
]
},
methods: {
add(){
this.items.push(this.input);
this.input = '';
},
removeItem(index){
this.items.splice(index, 1);
}
}
})
</script>
</body>
</html>

0 comments on commit 88dd842

Please sign in to comment.