const treeRef = ref<InstanceType<typeof ElTree>>() as any;
// 一键展开和收起
const clickExpand = () => {
Object.values(treeRef.value.store.nodesMap).forEach((v: any) => v.expand());
};
const clickCollapse = () => {
Object.values(treeRef.value.store.nodesMap).forEach((v: any) => v.collapse());
};
vue3中实现elementPlus树形控件一键展开和收起
于 2024-01-11 17:23:08 首次发布