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
  c037e87b_39c5_dd4d_b28d_7477dd65a1a0["genStatic()"]
  ce806ab8_847b_273b_e07c_0a796c2f76ae["genElement()"]
  ce806ab8_847b_273b_e07c_0a796c2f76ae -->|calls| c037e87b_39c5_dd4d_b28d_7477dd65a1a0
  56d1ac63_81aa_e60d_9132_8fea48dc8c53["genOnce()"]
  56d1ac63_81aa_e60d_9132_8fea48dc8c53 -->|calls| c037e87b_39c5_dd4d_b28d_7477dd65a1a0
  ce806ab8_847b_273b_e07c_0a796c2f76ae["genElement()"]
  c037e87b_39c5_dd4d_b28d_7477dd65a1a0 -->|calls| ce806ab8_847b_273b_e07c_0a796c2f76ae
  style c037e87b_39c5_dd4d_b28d_7477dd65a1a0 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' : ''
  })`
}

Subdomains

Calls

Frequently Asked Questions

What does genStatic() do?
genStatic() is a function in the vue codebase.
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