Home / Function/ isUnknownElement() — vue Function Reference

isUnknownElement() — vue Function Reference

Architecture documentation for the isUnknownElement() function in element.ts from the vue codebase.

Entity Profile

Dependency Diagram

graph TD
  484f292a_cf60_7bf6_d525_da7926ff6efe["isUnknownElement()"]
  4d125c89_577c_87d4_7d77_04bcda7b57d0["element.ts"]
  484f292a_cf60_7bf6_d525_da7926ff6efe -->|defined in| 4d125c89_577c_87d4_7d77_04bcda7b57d0
  fbd8a980_a1b2_9b2b_efe7_3ef60d93d143["isReservedTag()"]
  484f292a_cf60_7bf6_d525_da7926ff6efe -->|calls| fbd8a980_a1b2_9b2b_efe7_3ef60d93d143
  style 484f292a_cf60_7bf6_d525_da7926ff6efe fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/platforms/web/util/element.ts lines 50–72

export function isUnknownElement(tag: string): boolean {
  /* istanbul ignore if */
  if (!inBrowser) {
    return true
  }
  if (isReservedTag(tag)) {
    return false
  }
  tag = tag.toLowerCase()
  /* istanbul ignore if */
  if (unknownElementCache[tag] != null) {
    return unknownElementCache[tag]
  }
  const el = document.createElement(tag)
  if (tag.indexOf('-') > -1) {
    // https://stackoverflow.com/a/28210364/1070244
    return (unknownElementCache[tag] =
      el.constructor === window.HTMLUnknownElement ||
      el.constructor === window.HTMLElement)
  } else {
    return (unknownElementCache[tag] = /HTMLUnknownElement/.test(el.toString()))
  }
}

Domain

Subdomains

Frequently Asked Questions

What does isUnknownElement() do?
isUnknownElement() is a function in the vue codebase, defined in src/platforms/web/util/element.ts.
Where is isUnknownElement() defined?
isUnknownElement() is defined in src/platforms/web/util/element.ts at line 50.
What does isUnknownElement() call?
isUnknownElement() calls 1 function(s): isReservedTag.

Analyze Your Own Codebase

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

Try Supermodel Free