-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue-demo.html
57 lines (55 loc) · 1.26 KB
/
vue-demo.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
<div class="app">
<div class="container">
<input type="text" placeholder="ToDo"
name="todo" v-model="todo">
<button @click="add">
Hinzufügen
</button>
</div>
<div class="container">
<div class="header">
Meine ToDo's
</div>
<ul class="todo-content">
<li v-for="item in todos">
{{ item }}
</li>
</ul>
<div class="empty-todo-list" v-if="!todos.length">
Keine ToDos vorhanden
</div>
</div>
<div class="container code">
<pre><code>{{ todo }} </code></pre>
<pre><code>{{ todos }}</code></pre>
</div>
</div>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.6.10/vue.min.js"></script>
<script type="text/javascript">
new Vue({
el: '.app',
data: {
todo: '',
todos: []
},
methods: {
add () {
this.todos.push(this.todo)
this.todo = ''
}
}
})
</script>
<style type="text/css">
* {
font-family: 'Open Sans', sans-serif;
box-sizing: border-box;
}
.container.code {
border-radius:3px;
background: #ddd;
color: #333;
padding: 10px;
width: 200px;
}
</style>