-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Types generated by ExtractPropTypes treat optional properties as required #5272
Comments
|
It is still recommended to consider it. If it can be done, the component does not need to maintain the type definition of the component itself, and it can be extracted directly with ExtractPropsTypes. Should this be considered a new requirement? I may not have made my real needs clear. For more discussion on this need, see here |
I guess what you want is a separate |
Yes, I hope Vue can provide such a processing method. |
@yyx990803 I heavily use As we are already working on type improvements for vue 3.3, adding Here's how I reuse props: https://github.com/jd-solanki/anu/blob/main/packages/anu-vue/src/components/card/props.ts#L6-L29 If possible can you please reopen the issue or should I create new issue for tracking this feature request? Regards. |
Version
3.2.27
Reproduction link
codesandbox.io
Steps to reproduce
打开链接,鼠标放到第18行中的“b”变量上面。
Open the link, mouse over the "b" variable in line 18.
What is expected?
不要将required属性为false的属性标记为必选属性
Don't mark a property with the required property false as required
What is actually happening?
将可选prop标记成了必选
Treat optional properties as required
Similar to #3122
The text was updated successfully, but these errors were encountered: