]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: adjust resolveDynamicComponent return type
authorEvan You <yyx990803@gmail.com>
Tue, 7 Jul 2020 16:43:05 +0000 (12:43 -0400)
committerEvan You <yyx990803@gmail.com>
Tue, 7 Jul 2020 16:43:05 +0000 (12:43 -0400)
packages/runtime-core/src/helpers/resolveAssets.ts

index c0e38772f709ee23e78b1f6f3bb0539c09351e3c..03a83337b979648fa44f77156545b432faa2bc08 100644 (file)
@@ -3,6 +3,7 @@ import { currentInstance, Component, FunctionalComponent } from '../component'
 import { Directive } from '../directives'
 import { camelize, capitalize, isString } from '@vue/shared'
 import { warn } from '../warning'
+import { VNodeTypes } from '../vnode'
 
 const COMPONENTS = 'components'
 const DIRECTIVES = 'directives'
@@ -19,14 +20,12 @@ export const NULL_DYNAMIC_COMPONENT = Symbol()
 /**
  * @private
  */
-export function resolveDynamicComponent(
-  component: unknown
-): Component | string | typeof NULL_DYNAMIC_COMPONENT {
+export function resolveDynamicComponent(component: unknown): VNodeTypes {
   if (isString(component)) {
     return resolveAsset(COMPONENTS, component, false) || component
   } else {
     // invalid types will fallthrough to createVNode and raise warning
-    return (component as any) || NULL_DYNAMIC_COMPONENT
+    return (component || NULL_DYNAMIC_COMPONENT) as any
   }
 }