Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #480 +/- ##
=======================================
Coverage 99.66% 99.67%
=======================================
Files 23 23
Lines 604 611 +7
Branches 182 186 +4
=======================================
+ Hits 602 609 +7
Misses 2 2 ☔ View full report in Codecov by Sentry. |
zombieJ
reviewed
Apr 8, 2024
zombieJ
reviewed
Apr 10, 2024
zombieJ
reviewed
Apr 10, 2024
zombieJ
reviewed
Apr 11, 2024
zombieJ
reviewed
Apr 11, 2024
zombieJ
approved these changes
Apr 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cascader 泛型优化,解决了 options + filedNames + value + onChange params Value 的类型检测不爽的问题
遗留问题:
一、由于
checkable有ReactNode类型,所以区分是否多选类型不完美,如下 5 种场景,会有 2 个 onChange value 为 any 类型,不过在 antd 没有此问题,antd 的 multiple 是 boolean 类型PS:支持
ReactNode也没什么历史背景,就是初设计就加上了类型 #184 导致没法去掉了04-10 进展
给 CascaderProps 增加 Multiple 泛型,用来判断是否是多选,可完美解决 ReactNode 检测不健壮问题,以及 onChange 方法需要使用 2 个类型:单选
SingleCascaderProps['onChange']多选MultipleCascaderProps['onChange']遗留问题:

由于 Value 泛型在 OptionType 泛型后面,所以当传了 value 没传 options,那 onChange 的 value 会是
DefaultOptionType['value']类型