mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
fix(components): [tree] filter update scheduling error (#20267)
* Update tree-store.ts fix: the bug #20259 Ensure the sequence for the traverse step. * fix(components): [tree] filter update scheduling error fix(components): [tree] fix bug #20259 Ensure the sequence for the traverse step. If call the traverse without await, the code below will run before the children had been processed, making the parent node invisible.
This commit is contained in:
@@ -350,7 +350,7 @@ describe('Tree.vue', () => {
|
||||
const treeWrapper = wrapper.findComponent(Tree)
|
||||
;(treeWrapper.vm as InstanceType<typeof Tree>).filter('2-1')
|
||||
|
||||
await nextTick()
|
||||
await sleep()
|
||||
expect(treeWrapper.findAll('.el-tree-node.is-hidden').length).toEqual(3)
|
||||
})
|
||||
test('lazy load with filter expand loaded node', async () => {
|
||||
|
||||
@@ -79,7 +79,7 @@ export default class TreeStore {
|
||||
if (index % 80 === 0 && index > 0) {
|
||||
await nextTick()
|
||||
}
|
||||
traverse(child)
|
||||
await traverse(child)
|
||||
}
|
||||
|
||||
if (!(node as Node).visible && childNodes.length) {
|
||||
|
||||
Reference in New Issue
Block a user