Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. /* TestComponent.vue */
  2.  
  3. <template>
  4. <span>
  5. I'm Test component
  6. </span>
  7. </template>
  8.  
  9. <script>
  10. export default {
  11. data() {
  12. return {
  13. amount: 0,
  14. };
  15. },
  16.  
  17. watch: {
  18. amount(newVal) {
  19. console.log(newVal);
  20. },
  21. },
  22.  
  23. beforeCreate() { this.amount = 1; },
  24. created() { this.amount = 2; },
  25. beforeMount() { this.amount = 3; },
  26. mounted() { this.amount = 4; },
  27. beforeDestroy() { this.amount = 5; },
  28. destroyed() { this.amount = 6; },
  29. };
  30. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement