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
  1b5974c6_1385_a2dc_0c7c_8cc8c4210866["initLifecycle()"]
  d937f76e_061f_a631_9587_336503c9a15c["lifecycle.ts"]
  1b5974c6_1385_a2dc_0c7c_8cc8c4210866 -->|defined in| d937f76e_061f_a631_9587_336503c9a15c
  27e71f35_12fd_58cc_25d7_c5686da5aaf6["initMixin()"]
  27e71f35_12fd_58cc_25d7_c5686da5aaf6 -->|calls| 1b5974c6_1385_a2dc_0c7c_8cc8c4210866
  style 1b5974c6_1385_a2dc_0c7c_8cc8c4210866 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, defined in src/core/instance/lifecycle.ts.
Where is initLifecycle() defined?
initLifecycle() is defined in src/core/instance/lifecycle.ts at line 35.
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