text: (window.webpackJsonp=window.webpackJsonp||[]).push([[35],{354:function(t,e,n){},441:function(t,e,n){"use strict";n(354)},551:function(t,e,n){"use strict";n.r(e);n(441);var s=n(25),a=Object(s.a)({},(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[n("h1",{attrs:{id:"_8-vue中的computed和watch的区别"}},[n("a",{staticClass:"header-anchor",attrs:{href:"#_8-vue中的computed和watch的区别"}},[t._v("#")]),t._v(" "),n("H2Icon"),t._v("8.Vue中的computed和watch的区别？")],1),t._v(" "),n("blockquote",[n("p",[t._v("原题地址："),n("a",{staticClass:"action-button",attrs:{href:"https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/1"}},[t._v("https://github.com/Advanced-Frontend/Daily-Interview-Question/issues/1")])])]),t._v(" "),n("p",[t._v("1、computed：是一个有缓存的watcher，依赖的属性发生变化就会更新视图。 适用于计算比较消耗性能的计算场景。当表达式过于\n复杂时，在模板中放入过多逻辑会让模板难以维护，可以将复杂的逻辑放入计算属性中处理")]),t._v(" "),n("p",[t._v("2、watch：没有缓存性，更多的是起到一个观察的作用。可以监听某些数据执行回调，当需要深度监听时，将deep:true开启即可。")]),t._v(" "),n("RightMenu")],1)}),[],!1,null,null,null);e.default=a.exports}}]);