learnin-some-vue/lessons/app.js

34 lines
469 B
JavaScript
Raw Permalink Normal View History

2018-04-17 03:19:06 +00:00
var component = {
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:19:06 +00:00
};
var component2 = {
template: '<span>butts</span>',
};
var app1 = new Vue({
el: '#app1',
components: {
'ts-cmp': component
}
2018-04-17 03:10:28 +00:00
});
2018-04-17 03:19:06 +00:00
var app2 = new Vue({
el: '#app2',
components: {
'ts-cmp': component2
}
2018-04-17 03:10:28 +00:00
2018-04-13 18:55:09 +00:00
});