File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
packages/runtime-core/src Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -123,13 +123,18 @@ export const updateSlots = (
123123 let deletionComparisonTarget = EMPTY_OBJ
124124 if ( vnode . shapeFlag & ShapeFlags . SLOTS_CHILDREN ) {
125125 if ( ( children as RawSlots ) . _ === 1 ) {
126- if ( ! ( vnode . patchFlag & PatchFlags . DYNAMIC_SLOTS ) ) {
127- // compiled AND static. this means we can skip removal of potential
128- // stale slots
126+ // compiled slots.
127+ if (
128+ // bail on dynamic slots (v-if, v-for, reference of scope variables)
129+ ! ( vnode . patchFlag & PatchFlags . DYNAMIC_SLOTS ) &&
130+ // bail on HRM updates
131+ ! ( __DEV__ && instance . parent && instance . parent . renderUpdated )
132+ ) {
133+ // compiled AND static.
134+ // no need to update, and skip stale slots removal.
129135 needDeletionCheck = false
130- }
131- // HMR force update
132- if ( __DEV__ && instance . parent && instance . parent . renderUpdated ) {
136+ } else {
137+ // compiled but dynamic - update slots, but skip normalization.
133138 extend ( slots , children as Slots )
134139 }
135140 } else {
You can’t perform that action at this time.
0 commit comments