genScopedSlot() — vue Function Reference
Architecture documentation for the genScopedSlot() function in index.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD db876b7b_004a_9015_7afa_993985df7520["genScopedSlot()"] 6a18399e_553e_fef8_6a39_746f79f94bd2["index.ts"] db876b7b_004a_9015_7afa_993985df7520 -->|defined in| 6a18399e_553e_fef8_6a39_746f79f94bd2 e76cb7d0_b3c3_6c47_2e67_6c6f84d32371["genScopedSlots()"] e76cb7d0_b3c3_6c47_2e67_6c6f84d32371 -->|calls| db876b7b_004a_9015_7afa_993985df7520 539756f9_3a11_1e1c_313e_d779ff83093a["genIf()"] db876b7b_004a_9015_7afa_993985df7520 -->|calls| 539756f9_3a11_1e1c_313e_d779ff83093a f1257d59_66c7_6288_39e7_c860744c0fdf["genFor()"] db876b7b_004a_9015_7afa_993985df7520 -->|calls| f1257d59_66c7_6288_39e7_c860744c0fdf c685f493_8cd2_1c26_d251_343fbd2a9498["genChildren()"] db876b7b_004a_9015_7afa_993985df7520 -->|calls| c685f493_8cd2_1c26_d251_343fbd2a9498 009d7fc7_09cb_184e_e93c_1f468ff505c0["genElement()"] db876b7b_004a_9015_7afa_993985df7520 -->|calls| 009d7fc7_09cb_184e_e93c_1f468ff505c0 style db876b7b_004a_9015_7afa_993985df7520 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/compiler/codegen/index.ts lines 489–511
function genScopedSlot(el: ASTElement, state: CodegenState): string {
const isLegacySyntax = el.attrsMap['slot-scope']
if (el.if && !el.ifProcessed && !isLegacySyntax) {
return genIf(el, state, genScopedSlot, `null`)
}
if (el.for && !el.forProcessed) {
return genFor(el, state, genScopedSlot)
}
const slotScope =
el.slotScope === emptySlotScopeToken ? `` : String(el.slotScope)
const fn =
`function(${slotScope}){` +
`return ${
el.tag === 'template'
? el.if && isLegacySyntax
? `(${el.if})?${genChildren(el, state) || 'undefined'}:undefined`
: genChildren(el, state) || 'undefined'
: genElement(el, state)
}}`
// reverse proxy v-slot without scope on this.$slots
const reverseProxy = slotScope ? `` : `,proxy:true`
return `{key:${el.slotTarget || `"default"`},fn:${fn}${reverseProxy}}`
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does genScopedSlot() do?
genScopedSlot() is a function in the vue codebase, defined in src/compiler/codegen/index.ts.
Where is genScopedSlot() defined?
genScopedSlot() is defined in src/compiler/codegen/index.ts at line 489.
What does genScopedSlot() call?
genScopedSlot() calls 4 function(s): genChildren, genElement, genFor, genIf.
What calls genScopedSlot()?
genScopedSlot() is called by 1 function(s): genScopedSlots.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free