Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="app">
- <my-cmp></my-cmp>
- <hr>
- <my-cmp></my-cmp>
- </div>
- Vue.component ('my-cmp', {
- data: function() {
- return {
- status: 'Critical'
- };
- },
- template: '<p>Status: {{ status }} (<button @click="changeStatus">Change</button>)</p>',
- methods: {
- changeStatus: function() {
- this.status: 'other';
- };
- }
- });
- new Vue ({
- el: '#app'
- });
Add Comment
Please, Sign In to add comment