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

data table 中当 renderExpand 返回 undefined 时,展开后会出现空白块 #3373

Closed
atAurora opened this issue Jul 28, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@atAurora
Copy link

TuSimple/naive-ui version (版本)

2.31.0

Vue version (Vue 版本)

3.2.13

Browser and its version (浏览器及其版本)

Chrome(103.0.5060.114)

System and its version (系统及其版本)

MacOS(11.6)

Node version (Node 版本)

Reappearance link (重现链接)

https://github.com/atAurora/naive-ui-datatable-bug

Reappearance steps (重现步骤)

打开项目,点击 data table 的展开按钮

Expected results (期望的结果)

renderExpand 并没有返回任何内容,展开后应该不渲染任何内容

Actual results (实际的结果)

展开后渲染空白块

Remarks (补充说明)

screenshot-20220728-142103

@github-actions github-actions bot added the untriaged need to sort label Jul 28, 2022
@07akioni 07akioni removed the untriaged need to sort label Jul 28, 2022
@07akioni
Copy link
Collaborator

你需要用 expandable 控制行是否可展开

@atAurora
Copy link
Author

atAurora commented Aug 1, 2022

比如以下场景:
展开后的内容仍然是一个 data table,data table 里面的数据可删除
expandable 当 展开的 data table 中没有数据的时候不显示
当把 data table 中的数据全部删除,展开按钮消失,此时最后的状态是展开的,就会有上述空白
expandable确实可以控制行是否展开,那么当expandable消失的时候,是不是下面可展开的内容也随之消失呢? @07akioni

@07akioni
Copy link
Collaborator

07akioni commented Aug 2, 2022

data table,data table 里面的数据可删除
expandable 当 展开的 data table 中没有数据的时候不显示
当把 data table 中的数据全部删除,展开按钮消失,此时最后的状态是展开的,就会有上述空白
expandable确实可以控制

按照预期是会的

@atAurora
Copy link
Author

atAurora commented Aug 3, 2022

data table,data table 里面的数据可删除
expandable 当 展开的 data table 中没有数据的时候不显示
当把 data table 中的数据全部删除,展开按钮消失,此时最后的状态是展开的,就会有上述空白
expandable确实可以控制

按照预期是会的

但是实际上下面可展开的内容并不会随之消失,上述场景下,当expandable消失的时候,下面可展开的内容依然会保持展开状态,此时渲染的就是renderExpand返回的内容,如果返回的是undefined,那么就会如Remarks (补充说明)中图片上那样,渲染一个空白块 @07akioni

@atAurora
Copy link
Author

atAurora commented Aug 3, 2022

@07akioni 07akioni reopened this Aug 9, 2022
@07akioni 07akioni added the bug Something isn't working label Aug 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants