-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
虚拟表格 #6814
Comments
https://www.naiveui.com/zh-CN/os-theme/components/data-table#virtual.vue 尝试使用 virtual-scroll、virtual-scroll-x 开启虚拟列表支持? |
所有的配置已经配置过了 用的官方的例子 只不过把render函数里渲染的组件比较复杂 拖动横向滚动条的时候很卡 |
首先,开启virtual-scroll、virtual-scroll-x 之后,他的渲染方式已经是虚拟列表模式了,性能是可以的,详见: 其次,没有demo 就没法判断性能瓶颈在哪里,到底是单个render 计算或者dom 结构太复杂,还是过度使用的过渡或者css 样式,还是虚拟列表的问题,还是单纯的数据量太大,这没法判断。 |
demo如下:
js部分
|
随便补了点代码测试了下,这写法卡顿很正常吧?
实测 (demo,仅演示,交互应该是有问题的) 可以参照”可切换的可编辑表格“,交互后才切换到编辑模式,不触发则直接渲染字符串,可以大幅提升性能。如果需求上需要看起来是个输入框,那CSS 做个外观上的操作吧。 |
Clear and concise description of the problem
n-data-table设置了虚拟滚动 如果render函数里渲染的是比较复杂的组件的时候 拖拽滚动条滚动还是非常卡顿
Suggested solution
希望增加一个虚拟表格的组件
Alternative
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: