From 81e69b29ecf992d215d8ddc56bf7e40661144595 Mon Sep 17 00:00:00 2001 From: Johnson Chu Date: Fri, 2 Jul 2021 01:48:23 +0800 Subject: [PATCH] feat(types): support IDE renaming for props (#3656) --- packages/runtime-core/src/componentProps.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 5f73fbd8416..cacd72102ba 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -109,7 +109,8 @@ type InferPropType = [T] extends [null] : T export type ExtractPropTypes = O extends object - ? { [K in RequiredKeys]: InferPropType } & + ? { [K in keyof O]?: unknown } & // This is needed to keep the relation between the option prop and the props, allowing to use ctrl+click to navigate to the prop options. see: #3656 + { [K in RequiredKeys]: InferPropType } & { [K in OptionalKeys]?: InferPropType } : { [K in string]: any }