element-ui tree控件单个选择节点
element-ui tree怎么选择单个叶子节点的解决方案。实现的效果如下:
废话不多说,上代码(如下图):
html:
<div class="recursionTree" v-if="showHierarchy">
<el-tree :data="data2" :props="defaultProps" ref="tree"
:expand-on-click-node="false" node-key="id"
:default-expanded-keys="[bbb]"
:highlight-current="true" :check-on-click-node="true"
@node-click="handleNodeClick">
</el-tree>
</div>
js:
onChangeBlur () {
this.showHierarchy = !this.showHierarchy;
if (this.showHierarchy) { // true 是展开 tree选择项
this.$nextTick(function () {
this.$