Function listFilter

根据关键词或自定义Hook过滤列表,支持根据数据对象的嵌套路径过滤,如: 'user.name'

const keyword = 'test';
const fields = ['username', 'email', 'phone'];

// 过滤列表,关键词搜索和自定义hook为或的关系
listFilter(list, {keyword, fields, relationOr: true, filterHook: (row) => {
return age > 18;
}})

// 关键词搜索和自定义hook为且的关系
listFilter(list, {keyword, fields, filterHook: (row) => {
return age > 18;
}})
  • Parameters

    Returns Record<string, any>[]