fix(types): app.component should accept defineComponent return type (#822)
fix #730
This commit is contained in:
parent
4dfd4b8dbd
commit
1e9d1319c3
@ -17,8 +17,8 @@ export interface App<HostElement = any> {
|
|||||||
config: AppConfig
|
config: AppConfig
|
||||||
use(plugin: Plugin, ...options: any[]): this
|
use(plugin: Plugin, ...options: any[]): this
|
||||||
mixin(mixin: ComponentOptions): this
|
mixin(mixin: ComponentOptions): this
|
||||||
component(name: string): Component | undefined
|
component(name: string): PublicAPIComponent | undefined
|
||||||
component(name: string, component: Component): this
|
component(name: string, component: PublicAPIComponent): this
|
||||||
directive(name: string): Directive | undefined
|
directive(name: string): Directive | undefined
|
||||||
directive(name: string, directive: Directive): this
|
directive(name: string, directive: Directive): this
|
||||||
mount(
|
mount(
|
||||||
@ -55,7 +55,7 @@ export interface AppConfig {
|
|||||||
export interface AppContext {
|
export interface AppContext {
|
||||||
config: AppConfig
|
config: AppConfig
|
||||||
mixins: ComponentOptions[]
|
mixins: ComponentOptions[]
|
||||||
components: Record<string, Component>
|
components: Record<string, PublicAPIComponent>
|
||||||
directives: Record<string, Directive>
|
directives: Record<string, Directive>
|
||||||
provides: Record<string | symbol, any>
|
provides: Record<string | symbol, any>
|
||||||
reload?: () => void // HMR only
|
reload?: () => void // HMR only
|
||||||
@ -168,7 +168,7 @@ export function createAppAPI<HostNode, HostElement>(
|
|||||||
if (__DEV__ && context.components[name]) {
|
if (__DEV__ && context.components[name]) {
|
||||||
warn(`Component "${name}" has already been registered in target app.`)
|
warn(`Component "${name}" has already been registered in target app.`)
|
||||||
}
|
}
|
||||||
context.components[name] = component as Component
|
context.components[name] = component
|
||||||
return app
|
return app
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user