fix(slots): differentiate dynamic/static compiled slots

fix #1557
This commit is contained in:
Evan You
2020-07-13 12:36:41 -04:00
parent ba3b3cdda9
commit 65beba98fe
7 changed files with 143 additions and 120 deletions

View File

@@ -1,5 +1,5 @@
import { Data } from '../component'
import { Slots } from '../componentSlots'
import { Slots, RawSlots, CompiledSlotTypes } from '../componentSlots'
import {
VNodeArrayChildren,
openBlock,
@@ -39,7 +39,9 @@ export function renderSlot(
Fragment,
{ key: props.key },
slot ? slot(props) : fallback ? fallback() : [],
slots._ ? PatchFlags.STABLE_FRAGMENT : PatchFlags.BAIL
(slots as RawSlots)._ === CompiledSlotTypes.STATIC
? PatchFlags.STABLE_FRAGMENT
: PatchFlags.BAIL
)
)
}