fix(types): declared prop keys should always exist in props argument (#3726)

This commit is contained in:
GU Yiling
2021-05-13 05:47:31 +08:00
committed by GitHub
parent f01aadf2a1
commit 9b160b9405
3 changed files with 54 additions and 5 deletions

View File

@@ -65,7 +65,7 @@ import {
import { warn } from './warning'
import { VNodeChild } from './vnode'
import { callWithAsyncErrorHandling } from './errorHandling'
import { UnionToIntersection } from './helpers/typeUtils'
import { LooseRequired, UnionToIntersection } from './helpers/typeUtils'
import { deepMergeData } from './compat/data'
import { DeprecationTypes } from './compat/compatConfig'
import {
@@ -130,9 +130,13 @@ export interface ComponentOptionsBase<
ComponentCustomOptions {
setup?: (
this: void,
props: Props &
UnionToIntersection<ExtractOptionProp<Mixin>> &
UnionToIntersection<ExtractOptionProp<Extends>>,
props: Readonly<
LooseRequired<
Props &
UnionToIntersection<ExtractOptionProp<Mixin>> &
UnionToIntersection<ExtractOptionProp<Extends>>
>
>,
ctx: SetupContext<E>
) => Promise<RawBindings> | RawBindings | RenderFunction | void
name?: string