-
-
Notifications
You must be signed in to change notification settings - Fork 144
feat: add showCheckedStrategy #255
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
feat: add showCheckedStrategy #255
Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/cascader/4RQDxsPZVetpJcKDQGuKXywNBQEX |
Codecov Report
@@ Coverage Diff @@
## master #255 +/- ##
=======================================
Coverage 99.79% 99.79%
=======================================
Files 15 15
Lines 491 495 +4
Branches 125 128 +3
=======================================
+ Hits 490 494 +4
Misses 1 1
Continue to review full report at Codecov.
|
src/utils/treeUtil.ts
Outdated
| if (children && children.find(child => child.key && valueSet.has(child.key))) { | ||
| return false; | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感觉可以简化一下,另外用 some 可能比较好?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/Cascader.tsx
Outdated
| export type SingleValueType = (string | number)[]; | ||
|
|
||
| export type ValueType = SingleValueType | SingleValueType[]; | ||
| export type ShowCheckedStrategy = 'parent' | 'child'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
像 TreeSelect 一样搞个常量?字面量不是很好维护
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
|
|
不需要我做什么操作了吧 |
|
需要更新下文档和依赖,最好能和 TreeSelect 一样把 strategy 挂在 Cascader 下面 |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
ant-design/ant-design#34193
💡 Background and solution
📝 Changelog
showCheckedStrategyto'parent'|'child''for value typeshowCheckedStrategy为'parent'|'child'选择返回值方式☑️ Self Check before Merge