mirror of https://github.com/vuejs/core.git
fix(types): fix app.component() typing with inline defineComponent
close #10843
This commit is contained in:
parent
eae0ccb8e0
commit
908f70adc0
|
@ -1959,3 +1959,17 @@ declare const ErrorMessage: {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
;<ErrorMessage name="password" class="error" />
|
;<ErrorMessage name="password" class="error" />
|
||||||
|
|
||||||
|
// #10843
|
||||||
|
createApp({}).component(
|
||||||
|
'SomeComponent',
|
||||||
|
defineComponent({
|
||||||
|
props: {
|
||||||
|
title: String,
|
||||||
|
},
|
||||||
|
setup(props) {
|
||||||
|
expectType<string | undefined>(props.title)
|
||||||
|
return {}
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
|
|
@ -42,7 +42,10 @@ export interface App<HostElement = any> {
|
||||||
|
|
||||||
mixin(mixin: ComponentOptions): this
|
mixin(mixin: ComponentOptions): this
|
||||||
component(name: string): Component | undefined
|
component(name: string): Component | undefined
|
||||||
component(name: string, component: Component | DefineComponent): this
|
component<T extends Component | DefineComponent>(
|
||||||
|
name: string,
|
||||||
|
component: T,
|
||||||
|
): this
|
||||||
directive<T = any, V = any>(name: string): Directive<T, V> | undefined
|
directive<T = any, V = any>(name: string): Directive<T, V> | undefined
|
||||||
directive<T = any, V = any>(name: string, directive: Directive<T, V>): this
|
directive<T = any, V = any>(name: string, directive: Directive<T, V>): this
|
||||||
mount(
|
mount(
|
||||||
|
|
Loading…
Reference in New Issue