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 -2
View File
@@ -139,7 +139,7 @@ export default createComponent({
if (province && province === city) {
arr.splice(1, 1);
}
return arr.filter((text) => text).join('/');
return arr.filter(Boolean).join('/');
}
return '';
});
@@ -223,7 +223,7 @@ export default createComponent({
};
const onAreaConfirm = (values: AreaColumnOption[]) => {
values = values.filter((value) => !!value);
values = values.filter(Boolean);
if (values.some((value) => !value.code)) {
Toast(t('areaEmpty'));