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

Table组件dataSource属性当一页的数据量200左右,滚动table会出现[Vue warn]: Unhandled error during execution of watcher callback #7457

Closed
1 task done
LinzhouWang opened this issue Mar 25, 2024 · 14 comments
Labels

Comments

@LinzhouWang
Copy link

LinzhouWang commented Mar 25, 2024

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

4.1.0

Environment

os version:Windows 11 教育版64位,browser version:Microsoft Edge 122.0.2365.92 (正式版本) (64 位), Vue version:vue@3.4.21

Reproduction link

https://www.antdv.com/components/table

Steps to reproduce

1.引入vue@3.4.21,ant-design-vue@4.1.0,使用table组件;
2.设置table的scroll="{ x: 1500, y: 300 }",columns="columns", dataSource="data", pagination="false";
3.在data中设置:
columns : [
{
title: 'Full Name',
width: 100,
dataIndex: 'name',
key: 'name',
fixed: 'left',
},
{
title: 'Age',
width: 100,
dataIndex: 'age',
key: 'age',
fixed: 'left',
},
{
title: 'Address',
dataIndex: 'address',
key: '1',
width: 150,
}],
data:[],
4.在mounted中给data赋值:
for (let i = 0; i < 200; i ) {
this.data.push({
key: i,
name: Edrward ${i},
age: 32,
address: London Park no. ${i},
});
}
5.上下滑动table的滚动条,多滑动几次就会出现[Vue warn]: Unhandled error during execution of watcher callback
at <Cell cellType="body" class=undefined ellipsis=undefined ... > ...

What is expected?

数据加载后,table表格能根据滚动条进行正常滑动

What is actually happening?

在用滚动条进行上下、左右滑动的时候,F12查看控制台出现:[Vue warn]: Unhandled error during execution of watcher callback
at <Cell cellType="body" class=undefined ellipsis=undefined ... > at <BodyRow key=353 rowKey=353 record= {key: 353, name: 'Edrward 353', age: 32, address: 'London Park no. 353'} ... >
at <TableBody data= ...

@qppq54s
Copy link

qppq54s commented Mar 28, 2024

我在codesandbox上尝试了下,没有复现。但是因为for (let i = 0; i < 200; i ) 这句导致了infinite loop。改成 for (let i = 0; i < 200; i++) 就好了

@LinzhouWang
Copy link
Author

LinzhouWang commented Mar 28, 2024 via email

@xiaogang12131
Copy link

@LinzhouWang 改成i++,也会有警告,还会导致栈溢出报错,这个解决了吗

@LinzhouWang
Copy link
Author

@LinzhouWang 改成i++,也会有警告,还会导致栈溢出报错,这个解决了吗
没有,他这个table组件应该有bug,改成原始的table了

@kingofu2y
Copy link

噢,我也遇到了,烦死了,应该有bug。

@yaokaibao-tre
Copy link

yaokaibao-tre commented Apr 28, 2024

@tangjinzhou
你好,上面反映的这个问题,vue版本3.4.x会出现,3.3.x是没问题的,后续可以解决一下么?

@xijinhua
Copy link

@yaokaibao-tre 你改成3.3.x 哪个版本,我试了好几个3的版本都不行

@yaokaibao-tre
Copy link

@yaokaibao-tre 你改成3.3.x 哪个版本,我试了好几个3的版本都不行

我用的3.3.4

@xijinhua
Copy link

xijinhua commented May 23, 2024 via email

@JToung
Copy link

JToung commented Jun 26, 2024

4.1.0版本也会有这个bug

@WHYXman
Copy link

WHYXman commented Jul 8, 2024

4.2.3也有这个bug

@helloword107
Copy link

最新的版本4.2.3也是这样,设置一页显示100条的时候,滚动滚动条,控制台就会显示这个警告,而且会卡死

@orionna319
Copy link

orionna319 commented Jul 12, 2024

I looked at the Vue official library and found that it might be caused by the change of computed logic after version 3.4. There are two solutions: one is to lower the Vue version, and the other is to use computed instead of eagerComputed, It works for me.

  1. Use computed instead of eagerComputed
  2. Lower the Vue version to 3.3.4

Before this, computed was used. I found that eagerComputed was written in this commit. Since there is no comment and no PR discussion, I don't know why it was changed to eagerComputed.

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

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

No branches or pull requests

10 participants