fix 对用例模块进行相关操作之后树组件自动折叠问题
This commit is contained in:
parent
5cc1ff291a
commit
aabfd2a38d
|
@ -9,8 +9,11 @@
|
||||||
<el-tree
|
<el-tree
|
||||||
class="filter-tree node-tree"
|
class="filter-tree node-tree"
|
||||||
:data="treeNodes"
|
:data="treeNodes"
|
||||||
|
:default-expanded-keys="expandedNode"
|
||||||
node-key="id"
|
node-key="id"
|
||||||
@node-drag-end="handleDragEnd"
|
@node-drag-end="handleDragEnd"
|
||||||
|
@node-expand="nodeExpand"
|
||||||
|
@node-collapse="nodeCollapse"
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
:expand-on-click-node="false"
|
:expand-on-click-node="false"
|
||||||
highlight-current
|
highlight-current
|
||||||
|
@ -64,6 +67,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
result: {},
|
result: {},
|
||||||
|
expandedNode: [],
|
||||||
filterText: "",
|
filterText: "",
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
children: "children",
|
children: "children",
|
||||||
|
@ -216,6 +220,12 @@ export default {
|
||||||
},
|
},
|
||||||
refreshNode() {
|
refreshNode() {
|
||||||
this.$emit("refresh");
|
this.$emit("refresh");
|
||||||
|
},
|
||||||
|
nodeExpand(data) {
|
||||||
|
this.expandedNode.push(data.id);
|
||||||
|
},
|
||||||
|
nodeCollapse(data) {
|
||||||
|
this.expandedNode.splice(this.expandedNode.indexOf(data.id), 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue