|
@@ -1152,6 +1152,7 @@ function baseCreateRenderer<
|
|
|
const nextTree = renderComponentRoot(instance)
|
|
const nextTree = renderComponentRoot(instance)
|
|
|
const prevTree = instance.subTree
|
|
const prevTree = instance.subTree
|
|
|
instance.subTree = nextTree
|
|
instance.subTree = nextTree
|
|
|
|
|
+ next.el = vnode.el
|
|
|
// beforeUpdate hook
|
|
// beforeUpdate hook
|
|
|
if (bu !== null) {
|
|
if (bu !== null) {
|
|
|
invokeHooks(bu)
|
|
invokeHooks(bu)
|
|
@@ -1673,36 +1674,40 @@ function baseCreateRenderer<
|
|
|
setRef(ref, null, parentComponent, null)
|
|
setRef(ref, null, parentComponent, null)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if ((vnodeHook = props && props.onVnodeBeforeUnmount) != null) {
|
|
|
|
|
+ invokeVNodeHook(vnodeHook, parentComponent, vnode)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (shapeFlag & ShapeFlags.COMPONENT) {
|
|
if (shapeFlag & ShapeFlags.COMPONENT) {
|
|
|
if (shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE) {
|
|
if (shapeFlag & ShapeFlags.COMPONENT_SHOULD_KEEP_ALIVE) {
|
|
|
;(parentComponent!.sink as KeepAliveSink).deactivate(vnode)
|
|
;(parentComponent!.sink as KeepAliveSink).deactivate(vnode)
|
|
|
} else {
|
|
} else {
|
|
|
unmountComponent(vnode.component!, parentSuspense, doRemove)
|
|
unmountComponent(vnode.component!, parentSuspense, doRemove)
|
|
|
}
|
|
}
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- if (__FEATURE_SUSPENSE__ && shapeFlag & ShapeFlags.SUSPENSE) {
|
|
|
|
|
- vnode.suspense!.unmount(parentSuspense, doRemove)
|
|
|
|
|
- return
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (__FEATURE_SUSPENSE__ && shapeFlag & ShapeFlags.SUSPENSE) {
|
|
|
|
|
+ vnode.suspense!.unmount(parentSuspense, doRemove)
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if ((vnodeHook = props && props.onVnodeBeforeUnmount) != null) {
|
|
|
|
|
- invokeVNodeHook(vnodeHook, parentComponent, vnode)
|
|
|
|
|
- }
|
|
|
|
|
- if (shouldInvokeDirs) {
|
|
|
|
|
- invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount')
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (shouldInvokeDirs) {
|
|
|
|
|
+ invokeDirectiveHook(vnode, null, parentComponent, 'beforeUnmount')
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (dynamicChildren != null) {
|
|
|
|
|
- // fast path for block nodes: only need to unmount dynamic children.
|
|
|
|
|
- unmountChildren(dynamicChildren, parentComponent, parentSuspense)
|
|
|
|
|
- } else if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
|
|
|
|
- unmountChildren(children as HostVNode[], parentComponent, parentSuspense)
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (dynamicChildren != null) {
|
|
|
|
|
+ // fast path for block nodes: only need to unmount dynamic children.
|
|
|
|
|
+ unmountChildren(dynamicChildren, parentComponent, parentSuspense)
|
|
|
|
|
+ } else if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
|
|
|
|
|
+ unmountChildren(
|
|
|
|
|
+ children as HostVNode[],
|
|
|
|
|
+ parentComponent,
|
|
|
|
|
+ parentSuspense
|
|
|
|
|
+ )
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- if (doRemove) {
|
|
|
|
|
- remove(vnode)
|
|
|
|
|
|
|
+ if (doRemove) {
|
|
|
|
|
+ remove(vnode)
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (
|
|
if (
|