vue中 el-tree如何高亮显示某一节点

项目中使用el-tree进行筛选表格,想要选中某节点时高亮显示,综合查的资料进行总结

1. :highlight-current="isShowGaoliang"为true或者false决定是否需要树高亮显示


          

2.通过点击树的某一节点设置isShowGaoliang为true,并通过获得该节点id,使该节点高亮this.$refs.deptTree.setCurrentKey(data.id)

setIssue(data, node, tree) {
      this.$nextTick(() => {
          // 使树筛选时选中的节点高亮显示
          this.isShowGaoliang = true
          this.$refs.deptTree.setCurrentKey(data.id)
      })

 

你可能感兴趣的:(vue中 el-tree如何高亮显示某一节点)