element-ui 动态控制树形菜单 default-expand-all 实现展开/关闭功能
伪代码如下:
//业务代码
js如下:
handleOpen() { //展开 this.refreshTree = false; this.isExpand = true; this.$nextTick(() => { this.refreshTree = true; }); }, handleClose() { //收起 this.refreshTree = false; this.isExpand = false; this.$nextTick(() => { this.refreshTree = true; }); },