默认选中树形的子节点方法this.$refs.tree.se
比如子节点id为7,
默认选中树形子节点 this.$refs.tree.setCurrentKey(7);
mounted () {
this.$refs.tree.setCurrentKey(7);
},
HTML代码
<el-tree
class="filter-tree"
:data="data"
@node-click="handleNodeClick"
:props="defaultProps"
highlight-current
node-key="id"
default-expand-all
:filter-node-method="filterNode"
ref="tree"
>