myblog icon indicating copy to clipboard operation
myblog copied to clipboard

"深入理解Vue的computed实现原理及其实现方式"一文中有个小错误

Open jackgreentemp opened this issue 6 years ago • 0 comments

原文链接:https://blog.seosiwei.com/detail/37

你好,感谢分享。第一个流程图以及文字描述是不是写错了?

“分析:调用vue.getfullname第一次会打印 '-----走了computed 之 getfullname------',即计算属性第一次计算了值,第二次调用时,不会再打印值即直接获取的缓存值,为什么第二次是获得的缓存值呢,因为第二次执行时watcher.dirty=true,就会直接返回watcher.value值”

yneqwemkrqdcwnq2q7p4atiyzsdegtkn

应该是watcher.dirty=true重新计算,watcher.dirty=false获取缓存吧?

jackgreentemp avatar Jan 25 '19 09:01 jackgreentemp