learnin-some-vue/lessons/app.js

17 lines
286 B
JavaScript
Raw Normal View History

2018-04-17 03:16:04 +00:00
Vue.component('ts-cmp', {
2018-04-17 03:10:28 +00:00
data() {
2018-04-17 03:16:04 +00:00
return {status: 'Critical'};
2018-04-17 03:10:28 +00:00
},
2018-04-17 03:16:04 +00:00
template: '<p> Server status {{ status }} <button @click="changeStatus">XXX</button></p>',
methods: {
changeStatus(){
this.status = 'Normal';
}
}
2018-04-17 03:10:28 +00:00
});
2018-04-13 14:54:53 +00:00
var app = new Vue({
el: '#app',
2018-04-17 03:10:28 +00:00
2018-04-13 18:55:09 +00:00
});