All files / runtime/src resolveAssets.ts

0% Statements 0/26
0% Branches 0/1
0% Functions 0/1
0% Lines 0/26

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27                                                     
import {
  Component,
  resolveComponent as _resolveComponent
} from '@vue/runtime-core'
import { ActionBar, isKnownView, Tabs } from '.'

export function resolveComponent(name: string): Component | string | undefined {
  // in the standalone compiler, everything is treated as a component because we don't
  // know if certain tags are elements or not at runtime
  // (they are only registered at runtime with registerElement)
  // if we return a string here, vue will render them as normal elements
  // with the default slot as children
  if (isKnownView(name)) {
    return name
  }

  // todo: refactor to not have to hardcode all built-in components
  if (name === 'ActionBar') {
    return ActionBar
  }
  if (name === 'Tabs') {
    return Tabs
  }

  return _resolveComponent(name)
}