当前位置:   article > 正文

element el-tree current-node-key无效 setCurrentKey()无效

el-tree current-node-key

可以结合 current-node-key属性和this.$refs['你绑定的值'].setCurrentKey()方法及this.$nexTick()同时使用

  1. <el-tree
  2. :data="leftList"
  3. :props="defaultProps"
  4. v-loading="loadNode"
  5. node-key="region"
  6. ref="refTree"
  7. :highlight-current="true"
  8. :default-expanded-keys="defaultShowNodes"
  9. :current-node-key="currentNodekey"
  10. @node-click="handleNodeClick" >
  11. </el-tree>
  12. this.$nextTick(() => {
  13. this.currentNodekey = res.data[0].region;
  14. this.$refs.refTree.setCurrentKey(this.currentNodekey);
  15. });

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/830727
推荐阅读
相关标签
  

闽ICP备14008679号