Home / Function/ resolveAsset() — vue Function Reference

resolveAsset() — vue Function Reference

Architecture documentation for the resolveAsset() function in options.ts from the vue codebase.

Function typescript CoreInstance VDOM calls 4 called by 1

Entity Profile

Dependency Diagram

graph TD
  67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898["resolveAsset()"]
  4c03e6b5_515a_506e_9433_bf75e6caf6a5["renderStartingTag()"]
  4c03e6b5_515a_506e_9433_bf75e6caf6a5 -->|calls| 67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898
  f2fe9306_50d5_675e_2dfa_2c4d78443a49["hasOwn()"]
  67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898 -->|calls| f2fe9306_50d5_675e_2dfa_2c4d78443a49
  836e9c36_fe18_c1c8_9715_d916891f0517["camelize()"]
  67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898 -->|calls| 836e9c36_fe18_c1c8_9715_d916891f0517
  80f517e3_ada6_0ebb_d9d7_71865191cb06["capitalize()"]
  67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898 -->|calls| 80f517e3_ada6_0ebb_d9d7_71865191cb06
  e3484a9f_f8a5_4082_0208_641d58b965c3["warn()"]
  67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898 -->|calls| e3484a9f_f8a5_4082_0208_641d58b965c3
  style 67dda8cf_b5cf_1ffb_6ae2_8e3b81dcf898 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/core/util/options.ts lines 466–489

export function resolveAsset(
  options: Record<string, any>,
  type: string,
  id: string,
  warnMissing?: boolean
): any {
  /* istanbul ignore if */
  if (typeof id !== 'string') {
    return
  }
  const assets = options[type]
  // check local registration variations first
  if (hasOwn(assets, id)) return assets[id]
  const camelizedId = camelize(id)
  if (hasOwn(assets, camelizedId)) return assets[camelizedId]
  const PascalCaseId = capitalize(camelizedId)
  if (hasOwn(assets, PascalCaseId)) return assets[PascalCaseId]
  // fallback to prototype chain
  const res = assets[id] || assets[camelizedId] || assets[PascalCaseId]
  if (__DEV__ && warnMissing && !res) {
    warn('Failed to resolve ' + type.slice(0, -1) + ': ' + id)
  }
  return res
}

Domain

Subdomains

Frequently Asked Questions

What does resolveAsset() do?
resolveAsset() is a function in the vue codebase.
What does resolveAsset() call?
resolveAsset() calls 4 function(s): camelize, capitalize, hasOwn, warn.
What calls resolveAsset()?
resolveAsset() is called by 1 function(s): renderStartingTag.

Analyze Your Own Codebase

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

Try Supermodel Free