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

el-tree 增加虚拟滚动后,加载 26 万数据,报错:Maximum call stack size exceeded #91

Open
olokin opened this issue Aug 25, 2022 · 0 comments

Comments

@olokin
Copy link

olokin commented Aug 25, 2022

Describe the bug

经过排查,发现是对数据拍平函数,超过最大调用堆栈大小
对该方法进行了一些改进

Screenshots

lQLPJxafgVfVCq_NAuDNBlywfA-4DIjKwEwDBmZS-sCJAA_1628_736

tree.vue:
`flattenTree(datas) {
const conn = []
const flatten = arrs =>
arrs.forEach(data => {
if (data.visible) conn.push(data)
flatten(data.childNodes || [])
})

    flatten(datas)
    return conn
}`
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