Skip to content

Tree's loadData event cannot be triggered by expandedKeys? and want to expose the loadingKeys property #5733

@xiaosongmao123

Description

@xiaosongmao123
  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

3.2.6

Environment

edge 102

Reproduction link

https://www.antdv.com/components/tree-cn#API

Steps to reproduce

Tree,设置了loadData,expandedKeys 属性

1.点击node前面的箭头图标时会触发loadData事件,加载子节点

2.使用代码自动设置expandedKeys.value=[nodekey]时,不会触发loadData事件,不会加载子节点

What is expected?

.使用代码自动设置expandedKeys.value=[nodekey]时,节点展开,同时触发loadData

What is actually happening?

节点可以展开,但不会触发loadData事件,不会加载子节点


另外,看了一下vctree,是有公开loadingKeys属性的,tree没有公开,只是公开了公开loadedKeys属性。

但有特殊需求,我想要自己控制node节点显示加载中状态(不关心子节点,只是为了显示loading效果,给用户一个提示。之后会在settimeout里清除loadingKeys),所以希望可以公开loadingKeys属性,支持手动设置

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions