naive-ui icon indicating copy to clipboard operation
naive-ui copied to clipboard

DataTable的总结栏能不能固定在表格底部

Open list99197 opened this issue 2 years ago • 16 comments

This function solves the problem (这个功能解决的问题)

当总结栏固定在表格底部时,即使数据过多需要滑动查看,也可以直接看到总结栏,而不是滑到底部才能看到总结栏。

Expected API (期望的 API)

希望可以加个属性控制总结栏是否固定

list99197 avatar Apr 18 '22 14:04 list99197

这个应该有过类似的 issue,不过因为太复杂了还没有做

07akioni avatar Apr 18 '22 16:04 07akioni

好家伙,我刚想提来着,你直接替我提交了

labradorGitHubCanine avatar Apr 19 '22 09:04 labradorGitHubCanine

测试的时候发现是直接在最后添了一行,实在是不方便。

Blackcbears avatar Apr 21 '22 05:04 Blackcbears

如果着急使用,可以这样 .n-data-table-tr--summary td { position: sticky; bottom: 0; }

hawind avatar Jul 10 '22 03:07 hawind

也有这样写过,不过因为表格使用了scrollX,所以会导致总结栏跟上面的数据位置对不上

---原始邮件--- 发件人: @.> 发送时间: 2022年7月10日(周日) 中午11:04 收件人: @.>; 抄送: @.@.>; 主题: Re: [TuSimple/naive-ui] DataTable的总结栏能不能固定在表格底部 (Issue #2814)

如果着急使用,可以这样 .n-data-table-tr--summary td { position: sticky; bottom: 0; }

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

list99197 avatar Jul 10 '22 03:07 list99197

不知道你怎么出现位置对不上的情况,我这边测试是正常的

hawind avatar Jul 10 '22 03:07 hawind

是不是可以把总结栏合到表头里, 这样不管怎样滚动就不会影响了, 类似这样 image

JS-an avatar Oct 12 '22 02:10 JS-an

能否像固定表头一样做一个固定的底部,哈哈哈

liuyang0826 avatar Oct 13 '22 01:10 liuyang0826

#3858 这个pr应该可以解决固定问题

JS-an avatar Nov 25 '22 06:11 JS-an

如果着急使用,可以这样 .n-data-table-tr--summary td { position: sticky; bottom: 0; }

6,确实可以

leeGeng514 avatar Nov 13 '23 03:11 leeGeng514

如果着急使用,可以这样 .n-data-table-tr--summary td { position: sticky; bottom: 0; }

大佬 666 可用

lvjinze avatar Apr 07 '24 06:04 lvjinze

这个应该有过类似的 issue,不过因为太复杂了还没有做

希望作者可以支持一下固定底部、头部

lvjinze avatar Apr 07 '24 06:04 lvjinze

如果着急使用,可以这样 .n-data-table-tr--summary td { position: sticky; bottom: 0; }

测试过,大量数据+虚拟滚动(virtual-scroll)的情况下, position: sticky; bottom: 0; 是无效的,因为最后一行在没有滚动到底部的时候不被渲染。

所以还是要官方支持才行,比如总是渲染最后一行,然后应用这个 css。

poerlang avatar Apr 25 '24 08:04 poerlang