-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjscript.js
More file actions
53 lines (53 loc) · 877 Bytes
/
Copy pathjscript.js
File metadata and controls
53 lines (53 loc) · 877 Bytes
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
function kolor(kolor)
{
document.bgColor=kolor;
}
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!',
title: 'Strona załadowała się ' + new Date().toLocaleString()
}
})
Vue.component('todo-item', {
template: '\
<li>\
{{ title }}\
<button v-on:click="$emit(\'remove\')">Skasuj</button>\
</li>\
',
props: ['title']
})
new Vue({
el: '#todo-list',
data: {
newTodoText: '',
todos: [
{
id: 1,
title: 'opcja1',
},
{
id: 2,
title: 'opcja2',
},
{
id: 3,
title: 'opcja3'
}
],
nextTodoId: 4
},
methods: {
addNewTodo: function () {
this.todos.push({
id: this.nextTodoId++,
title: this.newTodoText
})
this.newTodoText = ''
}
showTodo: function() {
alert('showTodo');
}
}
})