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

使用virtual-scroll包裹el-table无法准确合并单元格,合并单元格会异常 #15

Closed
zhanghaifei1997 opened this issue Apr 9, 2023 · 2 comments

Comments

@zhanghaifei1997
Copy link

image

@xiaocheng555
Copy link
Owner

image

好的,我看看

@xiaocheng555
Copy link
Owner

xiaocheng555 commented Apr 12, 2023

image

最近有点忙,修复bug晚了点,抱歉。

bug产生原因:由于表格使用了虚拟滚动,只会渲染可见范围内的数据,滚动时会将合并行给割裂开来,使得部分行显示,部分不显示,导致显示错误。

解决方法 :对于行合并,增加rowSpanKey 属性去兼容,rowSpanKey函数需要返回每组合并行中共用的key值,组件内部会根据key值进行计算并完整显示合并行内容。如你给出的图中,key则为楼层对应的属性值,rowSpanKey(row) { return row[楼层] }。
版本升级到1.0.13

image

详细请看demo和源码:
https://xiaocheng555.github.io/el-table-virtual-scroll/#/Rowspan?code=Rowspan&codeTitle=%E5%90%88%E5%B9%B6%E8%A1%8C

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

No branches or pull requests

2 participants