Home / Function/ initInternalComponent() — vue Function Reference

initInternalComponent() — vue Function Reference

Architecture documentation for the initInternalComponent() function in init.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  cc8134ee_5d2b_e63d_3141_ffd3dea5e78b["initInternalComponent()"]
  340c5746_ff29_c74c_9da5_50db2db76e5f["initMixin()"]
  340c5746_ff29_c74c_9da5_50db2db76e5f -->|calls| cc8134ee_5d2b_e63d_3141_ffd3dea5e78b
  style cc8134ee_5d2b_e63d_3141_ffd3dea5e78b fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/instance/init.ts lines 84–104

export function initInternalComponent(
  vm: Component,
  options: InternalComponentOptions
) {
  const opts = (vm.$options = Object.create((vm.constructor as any).options))
  // doing this because it's faster than dynamic enumeration.
  const parentVnode = options._parentVnode
  opts.parent = options.parent
  opts._parentVnode = parentVnode

  const vnodeComponentOptions = parentVnode.componentOptions!
  opts.propsData = vnodeComponentOptions.propsData
  opts._parentListeners = vnodeComponentOptions.listeners
  opts._renderChildren = vnodeComponentOptions.children
  opts._componentTag = vnodeComponentOptions.tag

  if (options.render) {
    opts.render = options.render
    opts.staticRenderFns = options.staticRenderFns
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does initInternalComponent() do?
initInternalComponent() is a function in the vue codebase.
What calls initInternalComponent()?
initInternalComponent() is called by 1 function(s): initMixin.

Analyze Your Own Codebase

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

Try Supermodel Free