ViewUI icon indicating copy to clipboard operation
ViewUI copied to clipboard

[Bug Report]Cascader使用load-data时,如果获取到子项children=[],选中事件不再触发,需要再次点击

Open zhaoteee opened this issue 5 years ago • 2 comments

Environment

View UI(iView)版本为 4.0.

Reproduction link

https://run.iviewui.com/eG8kxokb

Steps to reproduce

加载子项children为空

What is expected?

Cascader使用load-data时,如果接口获取到子项children=[],选中事件继续触发

What is actually happening?

如果接口获取到子项children=[],无法继续选中

zhaoteee avatar Nov 14 '19 07:11 zhaoteee

if (cascader && cascader.loadData) { cascader.loadData(item, () => { // todo if (fromUser) { cascader.isLoadedChildren = true; } if (item.children.length) { this.handleTriggerItem(item); } }); return; } 源码中加item.children.length的原因是啥?children的长度为0,是否也可以继续选中

zhaoteee avatar Nov 14 '19 07:11 zhaoteee

都2022了,v4.7.0版本了,源码里面还是这样,注释着一行 // todo

Simon7520 avatar Mar 02 '22 02:03 Simon7520