美文网首页
element tree树 选中节点 并且 节点高亮

element tree树 选中节点 并且 节点高亮

作者: 魔仙堡杠把子灬 | 来源:发表于2021-12-16 18:29 被阅读0次

只为记录


在这里插入图片描述

<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>

相关文章

网友评论

      本文标题:element tree树 选中节点 并且 节点高亮

      本文链接:https://www.haomeiwen.com/subject/lnbvfrtx.html