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

希望Tree组件拖拽时支持allowDrop和selectable(是否允许可放置和是否可选中) #433

Open
beatzcs opened this issue Dec 17, 2021 · 1 comment
Assignees
Labels
feature request Request new feature

Comments

@beatzcs
Copy link

beatzcs commented Dec 17, 2021

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

  • Tree

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

  • allowDrop
  • selectable

Feature Description 功能描述

  • allowDrop - 是否允许可放置
  • selectable - 是否可选中

Additional information 补充说明

  • 现有这样一个场景,文件夹目录Tree结构,文件是不能被拖拽到文件里面去的,只能拖拽放置到目录里面。
    现在的api好像都可被放置进去,再比如省市区,只有上下级关系的才能被拖拽放置,这个功能还是蛮重要的。
    希望增加一个属性类似allowDrop,用来支持是否可放置,可参考antd。

  • 同样的场景,文件目录中文件夹只允许被折叠收起,不用选中,而文件则需要选中,希望增加一个属性类似selectable,用来支持是否可已选中,也可参考antd。

@beatzcs beatzcs changed the title 希望Tree组件拖拽时支持allowDrop(是否允许可放置) 希望Tree组件拖拽时支持allowDrop和selectable(是否允许可放置和是否可选中) Dec 17, 2021
@boomboomchen boomboomchen self-assigned this Dec 17, 2021
@boomboomchen boomboomchen added the feature request Request new feature label Dec 17, 2021
@boomboomchen
Copy link
Contributor

对于第一个问题,目前拖拽逻辑是可以由业务方来自定义决定是否可以拖放的,只是在样式上目前还未支持(比如:不允许拖拽的位置仍然会有高亮的拖拽线条)。我们后续会排期支持这个样式定义哈。
对于第二个问题,目前是可以通过renderFullLabel来实现的,可以参考下这个demo哈https://semi.design/zh-CN/navigation/tree#%E9%AB%98%E7%BA%A7%E5%AE%9A%E5%88%B6

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

2 participants