chore: improve filter (#8262)

This commit is contained in:
neverland
2021-03-04 11:27:39 +08:00
committed by GitHub
parent 9fd71923f9
commit 12be46fad8
10 changed files with 31 additions and 37 deletions
+2 -4
View File
@@ -221,9 +221,7 @@ export default createComponent({
const getValues = () => {
if (pickerRef.value) {
const values = pickerRef.value
.getValues()
.filter((value: AreaColumnOption) => !!value);
const values = pickerRef.value.getValues().filter(Boolean);
return parseValues(values);
}
return [];
@@ -244,7 +242,7 @@ export default createComponent({
}
const names = values.map((item) => item.name);
const validValues = values.filter((value) => !!value.code);
const validValues = values.filter((value) => value.code);
area.code = validValues.length
? validValues[validValues.length - 1].code