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

Function getSlotNode

packages/compiler-core/src/transforms/cacheStatic.ts:232–246  ·  view source on GitHub ↗
(
    node: VNodeCall,
    name: string | ExpressionNode,
  )

Source from the content-addressed store, hash-verified

230 }
231
232 function getSlotNode(
233 node: VNodeCall,
234 name: string | ExpressionNode,
235 ): SlotFunctionExpression | undefined {
236 if (
237 node.children &&
238 !isArray(node.children) &&
239 node.children.type === NodeTypes.JS_OBJECT_EXPRESSION
240 ) {
241 const slot = node.children.properties.find(
242 p => p.key === name || (p.key as SimpleExpressionNode).content === name,
243 )
244 return slot && slot.value
245 }
246 }
247
248 if (toCache.length && context.transformHoist) {
249 context.transformHoist(children, context, node)

Callers 1

walkFunction · 0.85

Calls 1

findMethod · 0.80

Tested by

no test coverage detected