只为记录
<el-tree :data="industryOptions" :props="defaultProps" @node-click="handleNodeClick" node-key="id" default-expand-all highlight-current ref="tree">
<script>
handleNodeClick(data) {
this.$nextTick(() => {
// 节点的id 传进来
this.$refs.tree.setCurrentKey(data.id);
});
this.fetchData();
},
</script>
<style>
::v-deep .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
background: #409eff;
}
</style>