Element Plus Tree组件实现展开折叠

Element Plus Tree组件实现展开折叠

<el-tree ref="treeRef"/>
 /**
 * 展开折叠tree
 * @param isExpand 控制展开折叠  展开:true、折叠:false
 */
const expandHandle = function (isExpand) {
   let nodes = treeRef.value.store.nodesMap;
    for (const node in nodes) {
        nodes[node].expanded = isExpand;
    }
}

你可能感兴趣的:(笔记,vue)