25 lines
617 B
JavaScript
25 lines
617 B
JavaScript
|
|
Vue.component('todo-item', {
|
|
props: ['todo'],
|
|
template: '<li>{{ todo.text }}</li>'
|
|
})
|
|
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
message: 'Hello Vue!',
|
|
showspan: true,
|
|
todos: [
|
|
{ id: 1, text: 'Learn JavaScript' },
|
|
{ id: 2, text: 'Learn Vue' },
|
|
{ id: 3, text: 'Build something awesome' }
|
|
],
|
|
label: 'You loaded this page on ' + new Date().toLocaleString()
|
|
},
|
|
methods: {
|
|
reverseMessage: function () {
|
|
this.message = this.message.split('').reverse().join('')
|
|
}
|
|
}
|
|
})
|