Home / Function/ initState() — vue Function Reference

initState() — vue Function Reference

Architecture documentation for the initState() function in state.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72["initState()"]
  340c5746_ff29_c74c_9da5_50db2db76e5f["initMixin()"]
  340c5746_ff29_c74c_9da5_50db2db76e5f -->|calls| 7d6ab8ef_bd4c_49b2_1b21_a805de50af72
  e399206d_b17d_5ac0_8caa_dab87591e37e["initProps()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| e399206d_b17d_5ac0_8caa_dab87591e37e
  87ac0b39_9319_5c07_1390_906641a5c4fe["initSetup()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| 87ac0b39_9319_5c07_1390_906641a5c4fe
  c4516673_9ce0_4e58_5d36_4c90d7d388b3["initMethods()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| c4516673_9ce0_4e58_5d36_4c90d7d388b3
  a06d5e75_873a_9e84_3260_353c9ffb6493["initData()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| a06d5e75_873a_9e84_3260_353c9ffb6493
  38718d0e_50b6_f32c_7ce6_c7fe083f1ba2["observe()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| 38718d0e_50b6_f32c_7ce6_c7fe083f1ba2
  c4c9a03b_1660_44a3_39d7_280f159fba8d["initComputed()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| c4c9a03b_1660_44a3_39d7_280f159fba8d
  c179f128_4f00_181f_2fb6_82df876bd8eb["initWatch()"]
  7d6ab8ef_bd4c_49b2_1b21_a805de50af72 -->|calls| c179f128_4f00_181f_2fb6_82df876bd8eb
  style 7d6ab8ef_bd4c_49b2_1b21_a805de50af72 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/instance/state.ts lines 52–70

export function initState(vm: Component) {
  const opts = vm.$options
  if (opts.props) initProps(vm, opts.props)

  // Composition API
  initSetup(vm)

  if (opts.methods) initMethods(vm, opts.methods)
  if (opts.data) {
    initData(vm)
  } else {
    const ob = observe((vm._data = {}))
    ob && ob.vmCount++
  }
  if (opts.computed) initComputed(vm, opts.computed)
  if (opts.watch && opts.watch !== nativeWatch) {
    initWatch(vm, opts.watch)
  }
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does initState() do?
initState() is a function in the vue codebase.
What does initState() call?
initState() calls 7 function(s): initComputed, initData, initMethods, initProps, initSetup, initWatch, observe.
What calls initState()?
initState() 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