Home / Function/ genStatic() — vue Function Reference

genStatic() — vue Function Reference

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

Function typescript VueCore GlobalAPI calls 1 called by 2

Entity Profile

Dependency Diagram

graph TD
  efed1b05_29b1_203b_9210_7f683c302bb9["genStatic()"]
  6a18399e_553e_fef8_6a39_746f79f94bd2["index.ts"]
  efed1b05_29b1_203b_9210_7f683c302bb9 -->|defined in| 6a18399e_553e_fef8_6a39_746f79f94bd2
  009d7fc7_09cb_184e_e93c_1f468ff505c0["genElement()"]
  009d7fc7_09cb_184e_e93c_1f468ff505c0 -->|calls| efed1b05_29b1_203b_9210_7f683c302bb9
  f9b375f7_0463_ff1f_5be6_7e356b4bded3["genOnce()"]
  f9b375f7_0463_ff1f_5be6_7e356b4bded3 -->|calls| efed1b05_29b1_203b_9210_7f683c302bb9
  009d7fc7_09cb_184e_e93c_1f468ff505c0["genElement()"]
  efed1b05_29b1_203b_9210_7f683c302bb9 -->|calls| 009d7fc7_09cb_184e_e93c_1f468ff505c0
  style efed1b05_29b1_203b_9210_7f683c302bb9 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