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});