MCPcopy
hub / github.com/vuejs/core / assignSlots

Function assignSlots

packages/runtime-core/src/componentSlots.ts:169–183  ·  view source on GitHub ↗
(
  slots: InternalSlots,
  children: Slots,
  optimized: boolean,
)

Source from the content-addressed store, hash-verified

167}
168
169const assignSlots = (
170 slots: InternalSlots,
171 children: Slots,
172 optimized: boolean,
173) => {
174 for (const key in children) {
175 // #2893
176 // when rendering the optimized slots by manually written render function,
177 // do not copy the `slots._` compiler flag so that `renderSlot` creates
178 // slot Fragment with BAIL patchFlag to force full updates
179 if (optimized || !isInternalKey(key)) {
180 slots[key] = children[key]
181 }
182 }
183}
184
185export const initSlots = (
186 instance: ComponentInternalInstance,

Callers 2

initSlotsFunction · 0.85
updateSlotsFunction · 0.85

Calls 1

isInternalKeyFunction · 0.85

Tested by

no test coverage detected