Home / Function/ initAssetRegisters() — vue Function Reference

initAssetRegisters() — vue Function Reference

Architecture documentation for the initAssetRegisters() function in assets.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  54f4d885_4170_983f_d5ec_565534aeadbd["initAssetRegisters()"]
  b44eb3a4_7cb3_6229_eafe_c01a5edb54b3["assets.ts"]
  54f4d885_4170_983f_d5ec_565534aeadbd -->|defined in| b44eb3a4_7cb3_6229_eafe_c01a5edb54b3
  157a933a_63b7_ebeb_71f9_e11bccd3097b["initGlobalAPI()"]
  157a933a_63b7_ebeb_71f9_e11bccd3097b -->|calls| 54f4d885_4170_983f_d5ec_565534aeadbd
  style 54f4d885_4170_983f_d5ec_565534aeadbd fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/global-api/assets.ts lines 5–35

export function initAssetRegisters(Vue: GlobalAPI) {
  /**
   * Create asset registration methods.
   */
  ASSET_TYPES.forEach(type => {
    // @ts-expect-error function is not exact same type
    Vue[type] = function (
      id: string,
      definition?: Function | Object
    ): Function | Object | void {
      if (!definition) {
        return this.options[type + 's'][id]
      } else {
        /* istanbul ignore if */
        if (__DEV__ && type === 'component') {
          validateComponentName(id)
        }
        if (type === 'component' && isPlainObject(definition)) {
          // @ts-expect-error
          definition.name = definition.name || id
          definition = this.options._base.extend(definition)
        }
        if (type === 'directive' && isFunction(definition)) {
          definition = { bind: definition, update: definition }
        }
        this.options[type + 's'][id] = definition
        return definition
      }
    }
  })
}

Domain

Subdomains

Called By

Frequently Asked Questions

What does initAssetRegisters() do?
initAssetRegisters() is a function in the vue codebase, defined in src/core/global-api/assets.ts.
Where is initAssetRegisters() defined?
initAssetRegisters() is defined in src/core/global-api/assets.ts at line 5.
What calls initAssetRegisters()?
initAssetRegisters() is called by 1 function(s): initGlobalAPI.

Analyze Your Own Codebase

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

Try Supermodel Free