iview [Feature Request] provides the ability to display asynchronous nodes

5tmbdcev  于 3个月前  发布在  其他
关注(0)|答案(3)|浏览(43)

What problem does this feature solve?

Just set expand to true will just expand tree node, but for async node which does not load data yet, it'll not load data automatically. So I want a way to expand node and load data automatically.

What does the proposed API look like?

Maybe use

this.$refs.tree.expand(item)
wqsoz72f

wqsoz72f1#

Translation of this issue:
What problem does this feature solve ###?
Just set expand to true will just expand tree node, but for async node which does not load data yet, it'll not load data automatically. So I want a automatically. way to expand node and load data
What does the proposed API look ### like?
Maybe use
.
This.$refs.tree.expand (item)
.

eni9jsuy

eni9jsuy2#

@limodou Tree supports async nodes.
Can you provide a jsFiddle with a example where it does not work?

iswrvxsc

iswrvxsc3#

I mean I want to expand an async node programmatically but not via click arrow. For example I set one node via "nodes[0].expand = true", and nodes[0].loading = false, and nodes[0].children = [], so I want it can trigger loadData method to load data, but it'll not.

For now, I just do it myself via loading data and append to nodes[0].children, and also set its expand to true.

相关问题