element icon indicating copy to clipboard operation
element copied to clipboard

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

Open olokin opened this issue 1 year ago • 0 comments

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
}`

olokin avatar Aug 25 '22 09:08 olokin