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
崔老师好,最近在研究reactivity模块,对应dep和effect之间知道有如下的关系,但当嵌套依赖复杂点,就搞不清楚了,请问你是怎么理解这一块的?
// effect 和dep之间的对应关系 targetMap: { target1: { key1: [effect1, effect2, ...], key2: [effect1, effect2, ...], key3: [effect1, effect2, ...], ... } } effect.deps = [ [effect1, effect2, ...], [effect1, effect2, ...], [effect1, effect2, ...], ... ]
但当加入computed,ref后,感觉有点绕不清了,比如:
const count = ref(0) const plusOne = computed(() => { return count.value + 1 }) effect(() => { // plusOne.value 和 count.value顺序不一样,输出结果不一样 // console.log( plusOne.value + count.value) console.log(count.value + plusOne.value) }) function plus() { count.value++ } plus()
再比如:
const count = ref(0) const plusOne = computed(() => { return count.value + 1 }) const plusTwo = computed(() => { return plusOne.value + 1 }) console.log(plusTwo.value)
The text was updated successfully, but these errors were encountered:
去看下 尤雨溪的视频就明白了
Sorry, something went wrong.
可以关注一波 #23
No branches or pull requests
崔老师好,最近在研究reactivity模块,对应dep和effect之间知道有如下的关系,但当嵌套依赖复杂点,就搞不清楚了,请问你是怎么理解这一块的?
但当加入computed,ref后,感觉有点绕不清了,比如:
再比如:
The text was updated successfully, but these errors were encountered: