We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
这里track函数应在if语句之前,不然if里面执行的effecFn会将activeEffect覆盖,导致错误的依赖收集 ,即后面track收集的activeEffect是错误的。
const obj = { get value ( ) { if (dirty) { value = effectFn( ) dirty = ture } //应把外层副作用收集提升到if前面,先调用track函数进行追踪 track(obj, 'value') } }
这个应该也是前面那个老哥说computed爆栈的原因,因为错误的收集导致依赖收集、触发依赖有问题
The text was updated successfully, but these errors were encountered:
霍老师快看看,如果没错我就可以把这个写进我校招简历啦嘻嘻嘻 . (给《vue设计与实现》勘误过哈)
Sorry, something went wrong.
3.2.37 版本中computed实现也是先调用track函数
No branches or pull requests
这里track函数应在if语句之前,不然if里面执行的effecFn会将activeEffect覆盖,导致错误的依赖收集 ,即后面track收集的activeEffect是错误的。
这个应该也是前面那个老哥说computed爆栈的原因,因为错误的收集导致依赖收集、触发依赖有问题
The text was updated successfully, but these errors were encountered: