<el-tree
                            :data="data"
                            show-checkbox
                            default-expand-all
                            ref="tree"
                            node-key="id"
                            :props="defaultProps"
                 :default-checked-keys="defaultSelect"
                            @node-click="handleNodeClick"
                      >
let res = this.$refs.tree.getCheckedKeys().concat(this.$refs.tree.getHalfCheckedKeys())
console.log(res)

// 全选 getCheckedKeys()
// 半选 getHalfCheckedKeys()

返回结果为数组

赋值给defaultSelect

初始化默认高亮

相关文章:

  • 2022-12-23
  • 2021-07-06
  • 2022-12-23
  • 2022-12-23
  • 2021-08-18
  • 2021-07-29
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-26
  • 2022-01-02
  • 2021-09-24
  • 2021-06-13
  • 2022-12-23
相关资源
相似解决方案