Commit 2fae006b authored by Leopoldthecoder's avatar Leopoldthecoder Committed by 杨奕

Cascader: fix filter

parent f457cd7f
...@@ -10,9 +10,13 @@ ...@@ -10,9 +10,13 @@
arr.forEach(item => { arr.forEach(item => {
const itemCopy = {}; const itemCopy = {};
configurableProps.forEach(prop => { configurableProps.forEach(prop => {
const propName = props[prop] || prop; let name = props[prop];
const value = item[propName]; let value = item[name];
if (value !== undefined) itemCopy[propName] = value; if (value === undefined) {
name = prop;
value = item[name];
}
if (value !== undefined) itemCopy[name] = value;
}); });
if (Array.isArray(item[childrenProp])) { if (Array.isArray(item[childrenProp])) {
itemCopy[childrenProp] = copyArray(item[childrenProp], props); itemCopy[childrenProp] = copyArray(item[childrenProp], props);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment