From 1e9d1319c3f66a0a7430a4f6ac7b508486894b6b Mon Sep 17 00:00:00 2001 From: hareku Date: Thu, 12 Mar 2020 23:19:30 +0900 Subject: [PATCH] fix(types): app.component should accept defineComponent return type (#822) fix #730 --- packages/runtime-core/src/apiCreateApp.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/runtime-core/src/apiCreateApp.ts b/packages/runtime-core/src/apiCreateApp.ts index 73ecd848..4f710511 100644 --- a/packages/runtime-core/src/apiCreateApp.ts +++ b/packages/runtime-core/src/apiCreateApp.ts @@ -17,8 +17,8 @@ export interface App { config: AppConfig use(plugin: Plugin, ...options: any[]): this mixin(mixin: ComponentOptions): this - component(name: string): Component | undefined - component(name: string, component: Component): this + component(name: string): PublicAPIComponent | undefined + component(name: string, component: PublicAPIComponent): this directive(name: string): Directive | undefined directive(name: string, directive: Directive): this mount( @@ -55,7 +55,7 @@ export interface AppConfig { export interface AppContext { config: AppConfig mixins: ComponentOptions[] - components: Record + components: Record directives: Record provides: Record reload?: () => void // HMR only @@ -168,7 +168,7 @@ export function createAppAPI( if (__DEV__ && context.components[name]) { warn(`Component "${name}" has already been registered in target app.`) } - context.components[name] = component as Component + context.components[name] = component return app },