Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* TestComponent.vue */
- <template>
- <span>
- I'm Test component
- </span>
- </template>
- <script>
- export default {
- data() {
- return {
- amount: 0,
- };
- },
- watch: {
- amount(newVal) {
- console.log(newVal);
- },
- },
- beforeCreate() { this.amount = 1; },
- created() { this.amount = 2; },
- beforeMount() { this.amount = 3; },
- mounted() { this.amount = 4; },
- beforeDestroy() { this.amount = 5; },
- destroyed() { this.amount = 6; },
- };
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement