diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index d840864454f..fdd2125c044 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -220,8 +220,8 @@ function doWatch( ) } - const instance = - getCurrentScope() === currentInstance?.scope ? currentInstance : null + const scope = getCurrentScope() + const instance = currentInstance const reactiveGetter = (source: object) => deep === true ? source // traverse will happen in wrapped getter below @@ -261,7 +261,7 @@ function doWatch( } else { // no cb -> simple effect getter = () => { - if (instance && instance.isUnmounted) { + if (scope && !scope.active) { return } if (cleanup) {