Home / Function/ initGlobalAPI() — vue Function Reference

initGlobalAPI() — vue Function Reference

Architecture documentation for the initGlobalAPI() function in index.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  ee699f75_f5be_8f7a_91c2_18232c62b421["initGlobalAPI()"]
  6090fc15_0543_136f_4e4a_ce1860382ce6["index.ts"]
  ee699f75_f5be_8f7a_91c2_18232c62b421 -->|defined in| 6090fc15_0543_136f_4e4a_ce1860382ce6
  c50e49cd_c223_e73e_c96d_1c8391fde3c1["observe()"]
  ee699f75_f5be_8f7a_91c2_18232c62b421 -->|calls| c50e49cd_c223_e73e_c96d_1c8391fde3c1
  7fe2dc3d_81de_32c3_a72f_6cfe53926acd["initUse()"]
  ee699f75_f5be_8f7a_91c2_18232c62b421 -->|calls| 7fe2dc3d_81de_32c3_a72f_6cfe53926acd
  8c170a2b_5cd2_357b_bd28_c103d298e40e["initMixin()"]
  ee699f75_f5be_8f7a_91c2_18232c62b421 -->|calls| 8c170a2b_5cd2_357b_bd28_c103d298e40e
  ce425d9f_05ad_8df9_9c70_37c35a2bdb0e["initExtend()"]
  ee699f75_f5be_8f7a_91c2_18232c62b421 -->|calls| ce425d9f_05ad_8df9_9c70_37c35a2bdb0e
  4c59a107_b6e6_9de7_cbeb_c76f0d664854["initAssetRegisters()"]
  ee699f75_f5be_8f7a_91c2_18232c62b421 -->|calls| 4c59a107_b6e6_9de7_cbeb_c76f0d664854
  style ee699f75_f5be_8f7a_91c2_18232c62b421 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/global-api/index.ts lines 20–68

export function initGlobalAPI(Vue: GlobalAPI) {
  // config
  const configDef: Record<string, any> = {}
  configDef.get = () => config
  if (__DEV__) {
    configDef.set = () => {
      warn(
        'Do not replace the Vue.config object, set individual fields instead.'
      )
    }
  }
  Object.defineProperty(Vue, 'config', configDef)

  // exposed util methods.
  // NOTE: these are not considered part of the public API - avoid relying on
  // them unless you are aware of the risk.
  Vue.util = {
    warn,
    extend,
    mergeOptions,
    defineReactive
  }

  Vue.set = set
  Vue.delete = del
  Vue.nextTick = nextTick

  // 2.6 explicit observable API
  Vue.observable = <T>(obj: T): T => {
    observe(obj)
    return obj
  }

  Vue.options = Object.create(null)
  ASSET_TYPES.forEach(type => {
    Vue.options[type + 's'] = Object.create(null)
  })

  // this is used to identify the "base" constructor to extend all plain-object
  // components with in Weex's multi-instance scenarios.
  Vue.options._base = Vue

  extend(Vue.options.components, builtInComponents)

  initUse(Vue)
  initMixin(Vue)
  initExtend(Vue)
  initAssetRegisters(Vue)
}

Domain

Subdomains

Frequently Asked Questions

What does initGlobalAPI() do?
initGlobalAPI() is a function in the vue codebase, defined in src/core/global-api/index.ts.
Where is initGlobalAPI() defined?
initGlobalAPI() is defined in src/core/global-api/index.ts at line 20.
What does initGlobalAPI() call?
initGlobalAPI() calls 5 function(s): initAssetRegisters, initExtend, initMixin, initUse, observe.

Analyze Your Own Codebase

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

Try Supermodel Free