1new Vue({
2 el: '#app',
3 data: {
4 text: 'Hello'
5 },
6 components: {
7 'child' : {
8 template: `<p>{{ myprop }}</p>`,
9 props: ['myprop'],
10 watch: {
11 myprop: function(newVal, oldVal) { // watch it
12 console.log('Prop changed: ', newVal, ' | was: ', oldVal)
13 }
14 }
15 }
16 }
17});
1 watch: {
2 $props: {
3 handler() {
4 this.parseData();
5 },
6 deep: true,
7 immediate: true,
8 },