Skip to content
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: 显示所有选中节点(包括父节点) #2233

Open
wants to merge 7 commits into
base: release
Choose a base branch
from

Conversation

LuyangFE
Copy link
Contributor

@LuyangFE LuyangFE commented May 11, 2024

English Template / 英文模板

  • 我已阅读并遵循了贡献文档中的PR指南.

PR类型 (请至少选择一个)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Test Case
  • TypeScript definition update
  • Document improve
  • CI/CD improve
  • Branch sync
  • Other, please describe:

PR 描述

Fixes #
feature 在Tree组件中新增了bothParents属性,用来在多选时,返回所有子节点时同时返回父节点
img_v3_02ap_0639f79c-b9b8-4f64-a744-2a9c5febc77g

更新日志

🇨🇳 Chinese

  • Feat: Tree、TreeSelect 增加 autoMergeValue API

🇺🇸 English

  • Feat: Tree、TreeSelect add autoMergeValue API

检查清单

  • 已增加测试用例或无须增加
  • 已补充文档或无须补充
  • Changelog已提供或无须提供

其他要求

  • 本条 PR 不需要纳入 Changelog

附加信息

img_v3_02ap_0639f79c-b9b8-4f64-a744-2a9c5febc77g

@LuyangFE LuyangFE changed the base branch from main to release May 11, 2024 14:51
Copy link

codesandbox-ci bot commented May 11, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 8b9fadc:

Sandbox Source
pr-story Configuration

@YyumeiZhang YyumeiZhang self-requested a review May 13, 2024 03:06
content/navigation/tree/index.md Outdated Show resolved Hide resolved
packages/semi-foundation/tree/foundation.ts Outdated Show resolved Hide resolved
@YyumeiZhang
Copy link
Collaborator

还需要考虑的点

  1. 受控时候,在 getDerivedState 部分计算 checkedKey,halfCheckedKey部分的计算(getDerivedState -> calcCheckedKeys->findDescendantKeys) 中是否需要计算 descendantKeys, 在父子节点作为 onChange 的 value 传出的话,看上去不需要再次计算 descendKeys, 省下此计算的性能)
  2. 英文文档 路径 content/navigation/tree/index-en-US.md
  3. 测试用例补充
  4. 方便的话,在 TreeSelect中补充同样的功能?

@YyumeiZhang YyumeiZhang force-pushed the feat/tree_select_with_parent branch from 1864f95 to 5a893a0 Compare June 3, 2024 12:25
@YyumeiZhang YyumeiZhang force-pushed the feat/tree_select_with_parent branch from 5a893a0 to 76acbf3 Compare June 3, 2024 12:52
@YyumeiZhang
Copy link
Collaborator

todo:
讨论下 autoMergeValue 这个命名是否正确,在 cascader 中是 autoMergeValue,Cascader 中作为返回值的是 value,但是 Tree/TreeSelect 中支持的是 key以及 value,名称 autoMergeValue 是否恰当?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants