剖析vue实现原理,自己动手实现mvvm
Geek Repo:Geek Repo
Github PK Tool:Github PK Tool
Sercl opened this issue 6 years ago · comments
在Watcher函数中有一个判断 if (typeof expOrFn === 'function') { this.getter = expOrFn } else { this.getter = this.parseGetter(expOrFn) } 我看示例里并没有为function的类型啊,什么情况下这里会触发function的逻辑呢?非常感谢
if (typeof expOrFn === 'function') { this.getter = expOrFn } else { this.getter = this.parseGetter(expOrFn) }
computed属性用到function