refactor(compiler-core): use more concise marker for compiled slots
This commit is contained in:
@@ -23,7 +23,7 @@ export type RawSlots = {
|
||||
// manual render fn hint to skip forced children updates
|
||||
$stable?: boolean
|
||||
// internal, indicates compiler generated slots = can skip normalization
|
||||
_compiled?: boolean
|
||||
_?: 1
|
||||
}
|
||||
|
||||
const normalizeSlotValue = (value: unknown): VNode[] =>
|
||||
@@ -51,7 +51,7 @@ export function resolveSlots(
|
||||
let slots: InternalSlots | void
|
||||
if (instance.vnode.shapeFlag & ShapeFlags.SLOTS_CHILDREN) {
|
||||
const rawSlots = children as RawSlots
|
||||
if (rawSlots._compiled) {
|
||||
if (rawSlots._ === 1) {
|
||||
// pre-normalized slots object generated by compiler
|
||||
slots = children as Slots
|
||||
} else {
|
||||
|
||||
@@ -35,7 +35,7 @@ export function renderSlot(
|
||||
Fragment,
|
||||
{ key: props.key },
|
||||
slot ? slot(props) : fallback || [],
|
||||
slots._compiled ? 0 : PatchFlags.BAIL
|
||||
slots._ ? 0 : PatchFlags.BAIL
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user