refactor(compiler-core): use more concise marker for compiled slots

This commit is contained in:
Evan You
2020-02-12 13:45:35 -05:00
parent 175f8aae8d
commit 1389d7b88c
11 changed files with 40 additions and 40 deletions

View File

@@ -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 {

View File

@@ -35,7 +35,7 @@ export function renderSlot(
Fragment,
{ key: props.key },
slot ? slot(props) : fallback || [],
slots._compiled ? 0 : PatchFlags.BAIL
slots._ ? 0 : PatchFlags.BAIL
)
)
}