halower / vue-tree

tree and multi-select component based on Vue.js 2.0
https://github.com/halower/vue2-tree/blob/master/README.md
MIT License
935 stars 209 forks source link

树懒加载,设置node.expanded=true节点没有展开加载数据 #124

Closed ronniesir closed 5 years ago

ronniesir commented 5 years ago

1.树懒加载,设置node.expanded=true 2.前方图标显示展开但节点没有展开加载数据 image

image

odanzhou commented 5 years ago

expanded是用来表示时候展开,本质上与加载数据没有一点关系,如果你需要在选择的时候异步加载节点,你需要自己实现为节点添加子节点的逻辑 如:在demo中,可以这样实现

nodechecked (node, v) {
  if ( v ) {
    this.$set(node, 'expanded', v)
    this.asyncLoad2(node)
  }
}