Skip to content

Commit

Permalink
fix: 🐛 bugfixed:isFilterValueExist function deal null valeu err
Browse files Browse the repository at this point in the history
✅ Closes: 3196
  • Loading branch information
2ue committed Nov 13, 2024
1 parent 3ea333c commit 1dae059
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/table/hooks/useFilter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@ import { useLocaleReceiver } from '../../locale/LocalReceiver';
import { getColumnsResetValue } from '../../_common/js/table/utils';

function isFilterValueExist(value: any) {
if (![null, '', undefined].includes(value)) return true;
const isArrayTrue = value instanceof Array && value.length;
const isObject = typeof value === 'object' && !(value instanceof Array);
const isObjectTrue = isObject && Object.keys(value).length;
return isArrayTrue || isObjectTrue;
const isObjectTrue = isObject && Object.keys(value || {}).length;
return isArrayTrue || isObjectTrue || ![null, '', undefined].includes(value);
}

// 筛选条件不为空,才需要显示筛选结果行
Expand Down

0 comments on commit 1dae059

Please sign in to comment.