learnin-some-vue/lessons/app.js
2018-04-16 23:19:21 -04:00

34 lines
469 B
JavaScript

var component = {
data() {
return {status: 'Critical'};
},
template: '<p> Server status {{ status }} <button @click="changeStatus">XXX</button></p>',
methods: {
changeStatus(){
this.status = 'Normal';
}
}
};
var component2 = {
template: '<span>butts</span>',
};
var app1 = new Vue({
el: '#app1',
components: {
'ts-cmp': component
}
});
var app2 = new Vue({
el: '#app2',
components: {
'ts-cmp': component2
}
});