Skip to content

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

@olokin

Description

@olokin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions