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

[Transfer] SourceHeaderProps在使用treeList模式时,能否支持全部数量、仅叶子节点数量的展示区分? #2581

Open
shaoerkuai opened this issue Nov 19, 2024 · 1 comment
Labels
feature request Request new feature

Comments

@shaoerkuai
Copy link

Which Component Need Enhancement 期望新增功能的组件

  • Transfer

What does the proposed API look like 期望支持的API

当前renderSourceHeader会提供SourceHeaderProps过来,里面有一个num表明当前待选数据源的节点数,但是这个数量的统计是包含了所有节点的,有时候希望对treeList树而言,上面的待选则数量,只展示叶子节点的数量。

比如文件夹内的文件选择,我希望上面展示的是:文件总数,而不是文件夹+加文件的总数。

Feature Description 功能描述

当type为treeList时,且tree的props的leafOnly为true时,SourceHeaderProps提供一个leafOnlyNum代表仅叶子节点数量。

Additional information 补充说明

目前的做法是:需要我拿到数据源后,自己进行一次计算非叶子节点的数量,然后再传给transfer数据源时,自定义renderSourceHeader对数值进行处理,减去这些数值,但是不够优雅。

@shaoerkuai shaoerkuai added the feature request Request new feature label Nov 19, 2024
@shaoerkuai
Copy link
Author

个人已经实现了,如果字节的同学评估认为这个需求不适合做在组件库中,可以直接关掉issue哈~

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

No branches or pull requests

1 participant