SOURCE

console 命令行工具 X clear

                    
>
console
var app = new Vue({
    el: '#app',
    data: {
        info: {
            name: 'vue',
        },
        title: 'react'
    },
    watch: {
        info: {
            deep: true,
            handler: function (info, lastInfo) {
                console.log('last:', lastInfo)
                console.log('current:', info)
            }
        },
        title(title, lastTitle) {
            console.log('current:', lastTitle)
            console.log('title:', title)
        }
    },
    methods: {
        onClick: function (e) {
            this.info = Object.assign(this.info, { value: 1 })
        },
        reverseMessage: function () {
            this.title = this.title
        }
    }
})
<div id="app">
	<div>{{ JSON.stringify(info) }}</div>
	<div>{{title}}</div>
	<button v-on:click="onClick">Click</button>
    <button v-on:click="reverseMessage">反转消息</button>
</div>

本项目引用的自定义外部资源