diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index 0c13e72988f..964e53cc683 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -220,9 +220,8 @@ function doWatch( ) } - const instance = - getCurrentScope() === currentInstance?.scope ? currentInstance : null - // const instance = currentInstance + const scope = getCurrentScope() + const instance = currentInstance let getter: () => any let forceTrigger = false let isMultiSource = false @@ -259,7 +258,7 @@ function doWatch( } else { // no cb -> simple effect getter = () => { - if (instance && instance.isUnmounted) { + if (scope && !scope.active) { return } if (cleanup) {