watch主要用来监听组件中某个值的改变,并执行对应的回调函数。 wtach和computed的区别 watch是一个值影响多个值 computed是多个值影响一个值 watch的内部原理 先看源码中对于vm.$watch的实现 // watch可以监听一个表达式(a.b.c)或者函数 Vue.prototype.$watch = function (expOrFn, cb, options) { const vm = this; options