fix(watch): ensure watchers respect detached scope

fix #4158
This commit is contained in:
Evan You
2021-07-20 14:32:17 -04:00
parent 2bdee50a59
commit bc7f9767f5
3 changed files with 46 additions and 15 deletions

View File

@@ -2304,9 +2304,8 @@ function baseCreateRenderer(
instance.emit('hook:beforeDestroy')
}
if (scope) {
scope.stop()
}
// stop effects in component scope
scope.stop()
// update may be null if a component is unmounted before its async
// setup has resolved.