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
  157a933a_63b7_ebeb_71f9_e11bccd3097b["initGlobalAPI()"]
  65cf792e_a676_cf99_19ca_1e38df384bdc["index.ts"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|defined in| 65cf792e_a676_cf99_19ca_1e38df384bdc
  b757abbc_61ef_2454_445e_6bb830e92333["observe()"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|calls| b757abbc_61ef_2454_445e_6bb830e92333
  1b92c3a3_73b6_48be_4ce3_36ba578fb4ed["initUse()"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|calls| 1b92c3a3_73b6_48be_4ce3_36ba578fb4ed
  f23a491f_3cce_715d_d3ea_b4eeddbcc08d["initMixin()"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|calls| f23a491f_3cce_715d_d3ea_b4eeddbcc08d
  9a536aa5_012c_cfe5_4928_935535d711d7["initExtend()"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|calls| 9a536aa5_012c_cfe5_4928_935535d711d7
  54f4d885_4170_983f_d5ec_565534aeadbd["initAssetRegisters()"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|calls| 54f4d885_4170_983f_d5ec_565534aeadbd
  style 157a933a_63b7_ebeb_71f9_e11bccd3097b 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