mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 12:38:53 +08:00
feat:filter match 扩充 * 用法 (#2216)
Co-authored-by: qinhaoyan <qinhaoyan@baidu.com>
This commit is contained in:
parent
f228d018b2
commit
d3a4b71a8e
@ -448,9 +448,12 @@ export const filters: {
|
||||
fn = value => reg.test(String(value));
|
||||
}
|
||||
|
||||
// 判断keys是否为*
|
||||
const isAsterisk = /\s*\*\s*/.test(keys);
|
||||
keys = keys.split(/\s*,\s*/);
|
||||
return input.filter((item: any) =>
|
||||
keys.some((key: string) => fn(resolveVariable(key, item), key, item))
|
||||
// 当keys为*时从item中获取key
|
||||
(isAsterisk ? Object.keys(item) : keys).some((key: string) => fn(resolveVariable(key, item), key, item))
|
||||
);
|
||||
},
|
||||
base64Encode(str) {
|
||||
|
Loading…
Reference in New Issue
Block a user