Home / Function/ cloneVNode() — vue Function Reference

cloneVNode() — vue Function Reference

Architecture documentation for the cloneVNode() function in vnode.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  3bd0be47_0029_9365_a5ae_2fa98a6da372["cloneVNode()"]
  079fe9e4_9316_0c39_6c2f_32a3b4a3e378["cloneAndMarkFunctionalResult()"]
  079fe9e4_9316_0c39_6c2f_32a3b4a3e378 -->|calls| 3bd0be47_0029_9365_a5ae_2fa98a6da372
  2da82d37_d0a8_bdfd_86ba_26432270288e["createPatchFunction()"]
  2da82d37_d0a8_bdfd_86ba_26432270288e -->|calls| 3bd0be47_0029_9365_a5ae_2fa98a6da372
  style 3bd0be47_0029_9365_a5ae_2fa98a6da372 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/vdom/vnode.ts lines 95–119

export function cloneVNode(vnode: VNode): VNode {
  const cloned = new VNode(
    vnode.tag,
    vnode.data,
    // #7975
    // clone children array to avoid mutating original in case of cloning
    // a child.
    vnode.children && vnode.children.slice(),
    vnode.text,
    vnode.elm,
    vnode.context,
    vnode.componentOptions,
    vnode.asyncFactory
  )
  cloned.ns = vnode.ns
  cloned.isStatic = vnode.isStatic
  cloned.key = vnode.key
  cloned.isComment = vnode.isComment
  cloned.fnContext = vnode.fnContext
  cloned.fnOptions = vnode.fnOptions
  cloned.fnScopeId = vnode.fnScopeId
  cloned.asyncMeta = vnode.asyncMeta
  cloned.isCloned = true
  return cloned
}

Domain

Subdomains

Frequently Asked Questions

What does cloneVNode() do?
cloneVNode() is a function in the vue codebase.
What calls cloneVNode()?
cloneVNode() is called by 2 function(s): cloneAndMarkFunctionalResult, createPatchFunction.

Analyze Your Own Codebase

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

Try Supermodel Free