59 字
1 分钟
Element-Plus 笔记

Tree#

Tree 组件

设置 Tree 组件全部展开#

const authTreeRef = ref();
// checkbox
const checkStrictly = ref(true);
// 展开
const expand = ref(false);
watch(
  () => expand.value,
  () => {
    console.log(`output->expand.value`, expand.value);
    let nodes = authTreeRef.value.store.nodesMap;
    for (const node in nodes) {
      nodes[node].expanded = expand.value;
      // nodes[node].checked = expand.value; 设置全选
    }
  }
);
Element-Plus 笔记
https://blog.kinoteika.com/posts/element-plus-tip/
作者
Kinoteika
发布于
2024-05-18
许可协议
CC BY-NC-SA 4.0