Guest User

Untitled

a guest
Dec 16th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. <div id="app">
  2. <my-cmp></my-cmp>
  3. <hr>
  4. <my-cmp></my-cmp>
  5. </div>
  6.  
  7. Vue.component ('my-cmp', {
  8. data: function() {
  9. return {
  10. status: 'Critical'
  11. };
  12. },
  13. template: '<p>Status: {{ status }} (<button @click="changeStatus">Change</button>)</p>',
  14. methods: {
  15. changeStatus: function() {
  16. this.status: 'other';
  17. };
  18. }
  19. });
  20.  
  21. new Vue ({
  22. el: '#app'
  23. });
Add Comment
Please, Sign In to add comment