Home / Function/ isStatic() — vue Function Reference

isStatic() — vue Function Reference

Architecture documentation for the isStatic() function in optimizer.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  78a02cff_e7b9_c4ef_d6d7_44de6eda5377["isStatic()"]
  aa905c19_18e1_1ec3_26d9_4dceaf61468a["markStatic()"]
  aa905c19_18e1_1ec3_26d9_4dceaf61468a -->|calls| 78a02cff_e7b9_c4ef_d6d7_44de6eda5377
  7f245c7d_5444_ebf2_35ab_3522e6471861["isDirectChildOfTemplateFor()"]
  78a02cff_e7b9_c4ef_d6d7_44de6eda5377 -->|calls| 7f245c7d_5444_ebf2_35ab_3522e6471861
  style 78a02cff_e7b9_c4ef_d6d7_44de6eda5377 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/compiler/optimizer.ts lines 103–122

function isStatic(node: ASTNode): boolean {
  if (node.type === 2) {
    // expression
    return false
  }
  if (node.type === 3) {
    // text
    return true
  }
  return !!(
    node.pre ||
    (!node.hasBindings && // no dynamic bindings
      !node.if &&
      !node.for && // not v-if or v-for or v-else
      !isBuiltInTag(node.tag) && // not a built-in
      isPlatformReservedTag(node.tag) && // not a component
      !isDirectChildOfTemplateFor(node) &&
      Object.keys(node).every(isStaticKey))
  )
}

Subdomains

Called By

Frequently Asked Questions

What does isStatic() do?
isStatic() is a function in the vue codebase.
What does isStatic() call?
isStatic() calls 1 function(s): isDirectChildOfTemplateFor.
What calls isStatic()?
isStatic() is called by 1 function(s): markStatic.

Analyze Your Own Codebase

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

Try Supermodel Free