1var vm = new Vue({
2 el: '#example',
3 data: {
4 message: 'Hello'
5 },
6 computed: {
7 // a computed getter
8 reversedMessage: function () {
9 // `this` points to the vm instance
10 return this.message.split('').reverse().join('')
11 }
12 }
13})
1vm.$watch('person.name.firstName', function(newValue, oldValue) {
2 alert('First name changed from ' + oldValue + ' to ' + newValue + '!');
3});