fix(reactivity): computed should not trigger scheduler if stopped

fix #4149
This commit is contained in:
Evan You
2021-07-19 13:37:03 -04:00
parent dd0f9d1ce6
commit 6eb47f000a
2 changed files with 21 additions and 1 deletions

View File

@@ -58,7 +58,7 @@ class ComputedRefImpl<T> {
scheduled = true
hasCompareTarget = false
scheduler(() => {
if (this._get() !== valueToCompare) {
if (this.effect.active && this._get() !== valueToCompare) {
triggerRefValue(this)
}
scheduled = false