Home / Function/ initState() — vue Function Reference

initState() — vue Function Reference

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

Function typescript CoreRuntime Instance calls 6 called by 1

Entity Profile

Dependency Diagram

graph TD
  ceeb400a_fb7f_c638_1feb_8311db20c105["initState()"]
  910d3a96_5984_cf85_40a3_47933bd75818["state.ts"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|defined in| 910d3a96_5984_cf85_40a3_47933bd75818
  7cb38e61_0473_03dc_2a46_4308c941e8cf["initMixin()"]
  7cb38e61_0473_03dc_2a46_4308c941e8cf -->|calls| ceeb400a_fb7f_c638_1feb_8311db20c105
  7f0dd149_783c_767f_2b75_50290f62a377["initProps()"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|calls| 7f0dd149_783c_767f_2b75_50290f62a377
  f7c79373_1fbf_e4fb_4790_62c19b86c8b3["initMethods()"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|calls| f7c79373_1fbf_e4fb_4790_62c19b86c8b3
  71dd8c80_4600_3a78_a4ac_26befd4658cc["initData()"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|calls| 71dd8c80_4600_3a78_a4ac_26befd4658cc
  c50e49cd_c223_e73e_c96d_1c8391fde3c1["observe()"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|calls| c50e49cd_c223_e73e_c96d_1c8391fde3c1
  7b0a7d03_cfef_5efb_b868_2bd41b0196d7["initComputed()"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|calls| 7b0a7d03_cfef_5efb_b868_2bd41b0196d7
  4a1391cc_a612_214d_dea9_12046e674c94["initWatch()"]
  ceeb400a_fb7f_c638_1feb_8311db20c105 -->|calls| 4a1391cc_a612_214d_dea9_12046e674c94
  style ceeb400a_fb7f_c638_1feb_8311db20c105 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, defined in src/core/instance/state.ts.
Where is initState() defined?
initState() is defined in src/core/instance/state.ts at line 52.
What does initState() call?
initState() calls 6 function(s): initComputed, initData, initMethods, initProps, 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