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

树 Tree组件数据量稍大时展开所有节点时会明显卡顿 #6163

Open
5 tasks done
maddenBoy opened this issue Jul 18, 2024 · 3 comments
Open
5 tasks done
Labels
untriaged need to sort

Comments

@maddenBoy
Copy link

描述错误

树 Tree组件数据量稍大时展开所有节点时会明显卡顿

复现步骤

1、打开链接
2、点击展开节点,此时发现明显卡顿(可调整treeNum变量,treeNum为6时没有明显卡顿,treeNum越大时卡顿越明显)

最小复现链接

https://codesandbox.io/s/wizardly-frost-rymj2j?file=/src/Demo.vue

系统信息

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 9 5900HX with Radeon Graphics        
    Memory: 7.59 GB / 31.40 GB
  Binaries:
    Node: 14.16.0 - ~\AppData\Local\Volta\tools\image\node\14.16.0\node.EXE
    Yarn: 1.22.19 - C:\Program Files\Volta\yarn.EXE
    npm: 6.14.11 - ~\AppData\Local\Volta\tools\image\node\14.16.0\npm.CMD
    pnpm: 8.14.1 - C:\Program Files\Volta\pnpm.EXE
  Browsers:
    Edge: Chromium (126.0.2592.102)
    Internet Explorer: 11.0.22621.3527

使用的包管理器

pnpm

验证

@maddenBoy maddenBoy added the untriaged need to sort label Jul 18, 2024
@Nakus0426
Copy link
Contributor

这么大量的数据,你应该把 virtual-scroll 开起来的,用你的例子试了下,开启虚拟列表后展开/折叠全部并没有明显的卡顿
PixPin_2024-07-22_15-24-53

@maddenBoy
Copy link
Author

没有设置高度、或者最大高度的场景似乎不适用这种解决方案

@Nakus0426
Copy link
Contributor

没有设置高度、或者最大高度的场景似乎不适用这种解决方案

那就没办法,这么多dom节点和数据不可能不卡
而且,这个高度也不一定是个静态值,只要指定了高度即可

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

No branches or pull requests

2 participants