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

Function normalizeVNodeSlots

packages/runtime-core/src/componentSlots.ts:151–167  ·  view source on GitHub ↗
(
  instance: ComponentInternalInstance,
  children: VNodeNormalizedChildren,
)

Source from the content-addressed store, hash-verified

149}
150
151const normalizeVNodeSlots = (
152 instance: ComponentInternalInstance,
153 children: VNodeNormalizedChildren,
154) => {
155 if (
156 __DEV__ &&
157 !isKeepAlive(instance.vnode) &&
158 !(__COMPAT__ && isCompatEnabled(DeprecationTypes.RENDER_FUNCTION, instance))
159 ) {
160 warn(
161 `Non-function value encountered for default slot. ` +
162 `Prefer function slots for better performance.`,
163 )
164 }
165 const normalized = normalizeSlotValue(children)
166 instance.slots.default = () => normalized
167}
168
169const assignSlots = (
170 slots: InternalSlots,

Callers 2

initSlotsFunction · 0.85
updateSlotsFunction · 0.85

Calls 4

isKeepAliveFunction · 0.90
isCompatEnabledFunction · 0.90
warnFunction · 0.90
normalizeSlotValueFunction · 0.85

Tested by

no test coverage detected