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

【BUG】dataTable截取tableData时计算错误,导致第n*countNumber+1项数据丢失 #226

Open
zx69 opened this issue Mar 11, 2024 · 0 comments

Comments

@zx69
Copy link

zx69 commented Mar 11, 2024

dataTable中,第440行计算的virtualData为formData.table?.slice?.(0, (countNumber.value + 1) * maxLength) || [], 但884行判断下一项取的是formData.table[(countNumber.value + 1) * maxLength + 1], 多加了1, 导致第31行,61行,91行...即30*n+1行数据不会加载。例如:

let maxLength = 10; // 设maxLength为10
let arr = [0,1,2,3,4,5,6,7,8,9,10]; // 数组arr包含11项数据
let virtualData = arr.slice(0, maxLength); // virtualData截取了前10项数据[0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
let rest = arr[maxLength + 1]; // rest=arr[11]为undefined,
// rest为undefined,887行的countNumber++不会执行,导致后面的第n*countNumber+1不会加载, arr第11项数据10丢失了

请确认884行判断是否应该改成formData.table[(countNumber.value + 1) * maxLength].
该bug会影响所有使用dataTable的页面的数据完整性,希望能优先处理, 谢谢!

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

1 participant