fix(slots): should update compiled dynamic slots
This commit is contained in:
parent
da6e64831a
commit
84440780f9
@ -123,13 +123,18 @@ export const updateSlots = (
|
|||||||
let deletionComparisonTarget = EMPTY_OBJ
|
let deletionComparisonTarget = EMPTY_OBJ
|
||||||
if (vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) {
|
if (vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) {
|
||||||
if ((children as RawSlots)._ === 1) {
|
if ((children as RawSlots)._ === 1) {
|
||||||
if (!(vnode.patchFlag & PatchFlags.DYNAMIC_SLOTS)) {
|
// compiled slots.
|
||||||
// compiled AND static. this means we can skip removal of potential
|
if (
|
||||||
// stale slots
|
// bail on dynamic slots (v-if, v-for, reference of scope variables)
|
||||||
|
!(vnode.patchFlag & PatchFlags.DYNAMIC_SLOTS) &&
|
||||||
|
// bail on HRM updates
|
||||||
|
!(__DEV__ && instance.parent && instance.parent.renderUpdated)
|
||||||
|
) {
|
||||||
|
// compiled AND static.
|
||||||
|
// no need to update, and skip stale slots removal.
|
||||||
needDeletionCheck = false
|
needDeletionCheck = false
|
||||||
}
|
} else {
|
||||||
// HMR force update
|
// compiled but dynamic - update slots, but skip normalization.
|
||||||
if (__DEV__ && instance.parent && instance.parent.renderUpdated) {
|
|
||||||
extend(slots, children as Slots)
|
extend(slots, children as Slots)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user