-
-
Notifications
You must be signed in to change notification settings - Fork 126
Closed
Description
感谢作者提供的强大的工具,在使用过程中有点关于watchEffect的疑惑
※vue的文档中:watchEffect会在同步执行过程中,自动追踪所有能访问到的响应式属性。
例如以下这样的地方:
const hasAutoRun = ref(false)
watchEffect(() => {
if (!manual && fetchInstance.options.refreshDeps !== true) {
hasAutoRun.value = unref(ready)
}
})
watchEffect在同步执行过程中修改了hasAutoRun,很容易造成Maximum recursive updates exceeded in component警告。是不是加个不相等的判断或者改成watch更好?
Metadata
Metadata
Assignees
Labels
No labels