Skip to content
This repository was archived by the owner on Jul 19, 2025. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions packages/runtime-vapor/src/componentSlots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,9 @@ export function initSlots(
if (!rawSlots) return
if (!isArray(rawSlots)) rawSlots = [rawSlots]

const hasDynamicSlots = rawSlots.length > 1 || isDynamicSlotFn(rawSlots[0])

const resolved: StaticSlots = (instance.slots = hasDynamicSlots
? shallowReactive({})
: {})

if (!hasDynamicSlots) {
Comment thread
LittleSound marked this conversation as resolved.
Outdated
const hasDynamicSlot = rawSlots.some(slot => isDynamicSlotFn(slot))
if (!hasDynamicSlot) {
instance.slots = {}
// with ctx
const slots = rawSlots[0] as StaticSlots
for (const name in slots) {
Expand All @@ -55,6 +51,7 @@ export function initSlots(
return
}

const resolved: StaticSlots = (instance.slots = shallowReactive({}))
const keys: Set<string>[] = []
rawSlots.forEach((slots, index) => {
const isDynamicSlot = isDynamicSlotFn(slots)
Expand Down