mirror of https://github.com/vuejs/core.git
fix(types): ensure `this.$props` type does not include `string` (#12123)
close #12122
This commit is contained in:
parent
d9d4d4e158
commit
704173e242
|
@ -2068,3 +2068,13 @@ expectString(instance.actionText)
|
||||||
// public prop on $props should be optional
|
// public prop on $props should be optional
|
||||||
// @ts-expect-error
|
// @ts-expect-error
|
||||||
expectString(instance.$props.actionText)
|
expectString(instance.$props.actionText)
|
||||||
|
|
||||||
|
// #12122
|
||||||
|
defineComponent({
|
||||||
|
props: { foo: String },
|
||||||
|
render() {
|
||||||
|
expectType<{ readonly foo?: string }>(this.$props)
|
||||||
|
// @ts-expect-error
|
||||||
|
expectType<string>(this.$props)
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
|
@ -265,7 +265,7 @@ export function defineComponent<
|
||||||
Mixin,
|
Mixin,
|
||||||
Extends,
|
Extends,
|
||||||
ResolvedEmits,
|
ResolvedEmits,
|
||||||
RuntimeEmitsKeys,
|
{},
|
||||||
{},
|
{},
|
||||||
false,
|
false,
|
||||||
InjectOptions,
|
InjectOptions,
|
||||||
|
|
Loading…
Reference in New Issue