|
|
@@ -360,14 +360,16 @@ function registerKeepAliveHook(
|
|
|
}
|
|
|
|
|
|
function injectToKeepAliveRoot(
|
|
|
- hook: Function,
|
|
|
+ hook: Function & { __weh?: Function },
|
|
|
type: LifecycleHooks,
|
|
|
target: ComponentInternalInstance,
|
|
|
keepAliveRoot: ComponentInternalInstance
|
|
|
) {
|
|
|
- injectHook(type, hook, keepAliveRoot, true /* prepend */)
|
|
|
+ // injectHook wraps the original for error handling, so make sure to remove
|
|
|
+ // the wrapped version.
|
|
|
+ const injected = injectHook(type, hook, keepAliveRoot, true /* prepend */)
|
|
|
onUnmounted(() => {
|
|
|
- remove(keepAliveRoot[type]!, hook)
|
|
|
+ remove(keepAliveRoot[type]!, injected)
|
|
|
}, target)
|
|
|
}
|
|
|
|