Home / Function/ initLifecycle() — vue Function Reference

initLifecycle() — vue Function Reference

Architecture documentation for the initLifecycle() function in lifecycle.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  4266126f_76b0_6d48_cc49_48dd682e88d3["initLifecycle()"]
  ad112c37_faea_8798_03f1_18e1a6303f0d["initMixin()"]
  ad112c37_faea_8798_03f1_18e1a6303f0d -->|calls| 4266126f_76b0_6d48_cc49_48dd682e88d3
  style 4266126f_76b0_6d48_cc49_48dd682e88d3 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/instance/lifecycle.ts lines 35–60

export function initLifecycle(vm: Component) {
  const options = vm.$options

  // locate first non-abstract parent
  let parent = options.parent
  if (parent && !options.abstract) {
    while (parent.$options.abstract && parent.$parent) {
      parent = parent.$parent
    }
    parent.$children.push(vm)
  }

  vm.$parent = parent
  vm.$root = parent ? parent.$root : vm

  vm.$children = []
  vm.$refs = {}

  vm._provided = parent ? parent._provided : Object.create(null)
  vm._watcher = null
  vm._inactive = null
  vm._directInactive = false
  vm._isMounted = false
  vm._isDestroyed = false
  vm._isBeingDestroyed = false
}

Domain

Subdomains

Called By

Frequently Asked Questions

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