由于自定义下拉树选框自定义筛选事件后更改了原数组的值
/**
* 过滤树节点
*/
filterNode (value, data, node) {
if (!value) return true
const _array = []; // 这里的数组存储,只是为了存储值
this.getReturnNode(node, _array, value);
let ressult = false;
_array.forEach(item => {
result = result || item
});
return result;
}
getReturnNode(node, _array, value) {
cosnt isPass = node.data && node.data[this.defaultProps.label] && node.data[this.defaultProps.label].indexOf(value) !== -1;
isPass ? _array.push(isPass) : '';
if (!isPass && node.level !== 1 && node.parent) {
this.getReturnNode(node.parent, _array, value)
}
}