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
  1d58f861_680d_2954_a51b_ed19382bb3ee["isStatic()"]
  18126178_83e0_0b6d_addc_14cbe5457ac9["markStatic()"]
  18126178_83e0_0b6d_addc_14cbe5457ac9 -->|calls| 1d58f861_680d_2954_a51b_ed19382bb3ee
  b31d34d2_5aa8_8102_930f_7c61f1423662["isDirectChildOfTemplateFor()"]
  1d58f861_680d_2954_a51b_ed19382bb3ee -->|calls| b31d34d2_5aa8_8102_930f_7c61f1423662
  style 1d58f861_680d_2954_a51b_ed19382bb3ee 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))
  )
}

Domain

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