-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
表格能否加个表头随页面滚动固定表头 #1555
Comments
这俩其实有点区别,antdv 那个要贴着页面顶端。我也不知道实现起来是不是麻烦 |
看了了antd vue用了 https://www.zhangxinxu.com/wordpress/2020/03/position-sticky-rules/ 一行css就可以搞定,但就是跟 |
和 zindex 相关? |
用设置了 用文档作为例子,给
我的理解是如果表头和希望粘连的滚动区域中间出现了其他设置了 |
看起来这个和 scrollY 是冲突的,所以我感觉可以只处理不能滚的状态。 而且我看他们的 sticky 还有一个比较复杂的模式,有 offset 啥的,不知道是是不是也可以 JS 计算,不过如果我们要做的话肯定是先做 CSS 方案,现有一个能 work 的版本。 |
JS思路估计大概就是创建一个IntersectionObserver观察表格位置,然后将表头设置成 |
先看看别人的实现再开始弄 |
现在按照你说的方法修改style都不能固定表头了,很需要这个功能 |
This issue does not have any recent activity. If you are still experiencing similar problems, open a new error, including a minimal copy of the problem |
请问有实现了吗 |
This function solves the problem (这个功能解决的问题)
对于长表格,需要滚动才能查看表头和滚动条
Expected API (期望的 API)
效果可以参考ant vue的表格:https://next.antdv.com/components/table-cn#components-table-demo-sticky
The text was updated successfully, but these errors were encountered: