mirror of https://github.com/ElemeFE/element
fix error log for cascader-panel
parent
2f4f6962c6
commit
032b87bbd5
|
@ -270,25 +270,27 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleExpand(node, silent) {
|
handleExpand(node, silent) {
|
||||||
const { activePath } = this;
|
if (node) {
|
||||||
const { level } = node;
|
const { activePath } = this;
|
||||||
const path = activePath.slice(0, level - 1);
|
const { level } = node;
|
||||||
const menus = this.menus.slice(0, level);
|
const path = activePath.slice(0, level - 1);
|
||||||
|
const menus = this.menus.slice(0, level);
|
||||||
|
|
||||||
if (!node.isLeaf) {
|
if (!node.isLeaf) {
|
||||||
path.push(node);
|
path.push(node);
|
||||||
menus.push(node.children);
|
menus.push(node.children);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.activePath = path;
|
this.activePath = path;
|
||||||
this.menus = menus;
|
this.menus = menus;
|
||||||
|
|
||||||
if (!silent) {
|
if (!silent) {
|
||||||
const pathValues = path.map(node => node.getValue());
|
const pathValues = path.map(node => node.getValue());
|
||||||
const activePathValues = activePath.map(node => node.getValue());
|
const activePathValues = activePath.map(node => node.getValue());
|
||||||
if (!valueEquals(pathValues, activePathValues)) {
|
if (!valueEquals(pathValues, activePathValues)) {
|
||||||
this.$emit('active-item-change', pathValues); // Deprecated
|
this.$emit('active-item-change', pathValues); // Deprecated
|
||||||
this.$emit('expand-change', pathValues);
|
this.$emit('expand-change', pathValues);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue