File tree 1 file changed +23
-10
lines changed
packages/runtime-core/src 1 file changed +23
-10
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,8 @@ import {
35
35
NOOP ,
36
36
invokeArrayFns ,
37
37
isArray ,
38
- getGlobalThis
38
+ getGlobalThis ,
39
+ isString
39
40
} from '@vue/shared'
40
41
import {
41
42
queueJob ,
@@ -2117,19 +2118,31 @@ function baseCreateRenderer(
2117
2118
doRemove
2118
2119
)
2119
2120
} else if (
2120
- dynamicChildren &&
2121
+ ( dynamicChildren || children ) &&
2121
2122
// #1153: fast path should not be taken for non-stable (v-for) fragments
2122
2123
( type !== Fragment ||
2123
2124
( patchFlag > 0 && patchFlag & PatchFlags . STABLE_FRAGMENT ) )
2124
2125
) {
2125
- // fast path for block nodes: only need to unmount dynamic children.
2126
- unmountChildren (
2127
- dynamicChildren ,
2128
- parentComponent ,
2129
- parentSuspense ,
2130
- false ,
2131
- true
2132
- )
2126
+ if ( dynamicChildren ) {
2127
+ // fast path for block nodes: only need to unmount dynamic children.
2128
+ unmountChildren (
2129
+ dynamicChildren ,
2130
+ parentComponent ,
2131
+ parentSuspense ,
2132
+ false ,
2133
+ true
2134
+ )
2135
+ }
2136
+
2137
+ if ( children ) {
2138
+ // #9239
2139
+ for ( let i = 0 ; i < ( children as VNode [ ] ) . length ; i ++ ) {
2140
+ const child = ( children as VNode [ ] ) [ i ]
2141
+ if ( child != null && ! isString ( child ) ) {
2142
+ unmount ( child , parentComponent , parentSuspense )
2143
+ }
2144
+ }
2145
+ }
2133
2146
} else if (
2134
2147
( type === Fragment &&
2135
2148
patchFlag &
You can’t perform that action at this time.
0 commit comments