genOnce() — vue Function Reference
Architecture documentation for the genOnce() function in index.ts from the vue codebase.
Entity Profile
Dependency Diagram
graph TD e6ae3747_8265_7dc5_77d6_fef4ab96c493["genOnce()"] 54260741_ae9d_a025_86de_47c513f5f82d["index.ts"] e6ae3747_8265_7dc5_77d6_fef4ab96c493 -->|defined in| 54260741_ae9d_a025_86de_47c513f5f82d 075d1f95_9965_89f4_3c01_f944fee6b553["genElement()"] 075d1f95_9965_89f4_3c01_f944fee6b553 -->|calls| e6ae3747_8265_7dc5_77d6_fef4ab96c493 016cc772_3198_eb71_716e_46e8192d13cc["genIfConditions()"] 016cc772_3198_eb71_716e_46e8192d13cc -->|calls| e6ae3747_8265_7dc5_77d6_fef4ab96c493 e9890815_0d7c_a227_7123_bb7fe2649918["genIf()"] e6ae3747_8265_7dc5_77d6_fef4ab96c493 -->|calls| e9890815_0d7c_a227_7123_bb7fe2649918 075d1f95_9965_89f4_3c01_f944fee6b553["genElement()"] e6ae3747_8265_7dc5_77d6_fef4ab96c493 -->|calls| 075d1f95_9965_89f4_3c01_f944fee6b553 539e85ff_376c_901f_0c90_8a9ec49163b2["genStatic()"] e6ae3747_8265_7dc5_77d6_fef4ab96c493 -->|calls| 539e85ff_376c_901f_0c90_8a9ec49163b2 style e6ae3747_8265_7dc5_77d6_fef4ab96c493 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/compiler/codegen/index.ts lines 174–200
function genOnce(el: ASTElement, state: CodegenState): string {
el.onceProcessed = true
if (el.if && !el.ifProcessed) {
return genIf(el, state)
} else if (el.staticInFor) {
let key = ''
let parent = el.parent
while (parent) {
if (parent.for) {
key = parent.key!
break
}
parent = parent.parent
}
if (!key) {
__DEV__ &&
state.warn(
`v-once can only be used inside v-for that is keyed. `,
el.rawAttrsMap['v-once']
)
return genElement(el, state)
}
return `_o(${genElement(el, state)},${state.onceId++},${key})`
} else {
return genStatic(el, state)
}
}
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does genOnce() do?
genOnce() is a function in the vue codebase, defined in src/compiler/codegen/index.ts.
Where is genOnce() defined?
genOnce() is defined in src/compiler/codegen/index.ts at line 174.
What does genOnce() call?
genOnce() calls 3 function(s): genElement, genIf, genStatic.
What calls genOnce()?
genOnce() is called by 2 function(s): genElement, genIfConditions.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free