feat(core): respect $stable slots flag per RFC

This commit is contained in:
Evan You
2019-11-26 10:03:36 -05:00
parent 009dc80674
commit 43097987cf
3 changed files with 52 additions and 2 deletions

View File

@@ -15,6 +15,9 @@ export type Slots = Readonly<InternalSlots>
export type RawSlots = {
[name: string]: unknown
// manual render fn hint to skip forced children updates
$stable?: boolean
// internal, indicates compiler generated slots = can skip normalization
_compiled?: boolean
}
@@ -49,6 +52,7 @@ export function resolveSlots(
} else {
slots = {}
for (const key in rawSlots) {
if (key === '$stable') continue
const value = rawSlots[key]
if (isFunction(value)) {
slots[key] = normalizeSlot(key, value)