Home / Function/ genStatic() — vue Function Reference

genStatic() — vue Function Reference

Architecture documentation for the genStatic() function in index.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  539e85ff_376c_901f_0c90_8a9ec49163b2["genStatic()"]
  54260741_ae9d_a025_86de_47c513f5f82d["index.ts"]
  539e85ff_376c_901f_0c90_8a9ec49163b2 -->|defined in| 54260741_ae9d_a025_86de_47c513f5f82d
  075d1f95_9965_89f4_3c01_f944fee6b553["genElement()"]
  075d1f95_9965_89f4_3c01_f944fee6b553 -->|calls| 539e85ff_376c_901f_0c90_8a9ec49163b2
  e6ae3747_8265_7dc5_77d6_fef4ab96c493["genOnce()"]
  e6ae3747_8265_7dc5_77d6_fef4ab96c493 -->|calls| 539e85ff_376c_901f_0c90_8a9ec49163b2
  075d1f95_9965_89f4_3c01_f944fee6b553["genElement()"]
  539e85ff_376c_901f_0c90_8a9ec49163b2 -->|calls| 075d1f95_9965_89f4_3c01_f944fee6b553
  style 539e85ff_376c_901f_0c90_8a9ec49163b2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/codegen/index.ts lines 157–171

function genStatic(el: ASTElement, state: CodegenState): string {
  el.staticProcessed = true
  // Some elements (templates) need to behave differently inside of a v-pre
  // node.  All pre nodes are static roots, so we can use this as a location to
  // wrap a state change and reset it upon exiting the pre node.
  const originalPreState = state.pre
  if (el.pre) {
    state.pre = el.pre
  }
  state.staticRenderFns.push(`with(this){return ${genElement(el, state)}}`)
  state.pre = originalPreState
  return `_m(${state.staticRenderFns.length - 1}${
    el.staticInFor ? ',true' : ''
  })`
}

Domain

Subdomains

Calls

Frequently Asked Questions

What does genStatic() do?
genStatic() is a function in the vue codebase, defined in src/compiler/codegen/index.ts.
Where is genStatic() defined?
genStatic() is defined in src/compiler/codegen/index.ts at line 157.
What does genStatic() call?
genStatic() calls 1 function(s): genElement.
What calls genStatic()?
genStatic() is called by 2 function(s): genElement, genOnce.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free