tusen-ai / naive-ui

A Vue 3 Component Library. Fairly Complete. Theme Customizable. Uses TypeScript. Fast.
https://www.naiveui.com
MIT License
16.01k stars 1.67k forks source link

data table的renderExpand,在有一个已展开的情况下,再执行其他的renderExpand,会执行多次 #6047

Closed wolfAndTime closed 1 month ago

wolfAndTime commented 3 months ago

描述错误

data table的renderExpand,在有一个已展开的情况下,再执行其他的renderExpand,会执行多次 用官方的例子在codesandbox试过了 image

复现步骤

在renderExpand的渲染函数里写个console.log("test"), 先展开一个,打印一个test,保持不关闭,在展开第二个的时候控制台连续打印两个test

最小复现链接

https://codesandbox.io/p/sandbox/boring-frog-zqv47z

系统信息

System:
    OS: Windows 11 10.0.22631
    CPU: (12) x64 AMD Ryzen 5 5600U with Radeon Graphics
    Memory: 1.81 GB / 13.84 GB
  Binaries:
    Node: 20.10.0 - D:\software install\nodeJs\node.EXE
    Yarn: 1.22.22 - D:\software install\nodeJs\node_modules\corepack\shims\yarn.CMD
    npm: 10.3.0 - D:\software install\nodeJs\node_modules\corepack\shims\npm.CMD
    pnpm: 9.1.2 - D:\software install\nodeJs\node_modules\corepack\shims\pnpm.CMD
  Browsers:
    Edge: Chromium (125.0.2535.92)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    naive-ui: ^2.38.2 => 2.38.2
    vue: ^3.4.27 => 3.4.27

使用的包管理器

npm

验证

jahnli commented 3 months ago

Sandbox not found

jizai1125 commented 3 months ago

data table的renderExpand,在有一个已展开的情况下,再执行其他的 renderExpand,会执行多次

应该是因为切换会导致所有行都重新渲染

jahnli commented 1 month ago

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