mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-04 21:08:55 +08:00
修复 filter 报错问题
This commit is contained in:
parent
5a6a4138a6
commit
2e03812ede
@ -242,11 +242,11 @@ export const filters: {
|
|||||||
arg1 = arg1 ? getStrOrVariable(arg1, this) : '';
|
arg1 = arg1 ? getStrOrVariable(arg1, this) : '';
|
||||||
fn = value => arg1 == value;
|
fn = value => arg1 == value;
|
||||||
} else if (directive === 'isIn') {
|
} else if (directive === 'isIn') {
|
||||||
let list:Array<any> = arg1 ? getStrOrVariable(arg1, this) : [];
|
let list: Array<any> = arg1 ? getStrOrVariable(arg1, this) : [];
|
||||||
list = Array.isArray(list) ? list : [];
|
list = Array.isArray(list) ? list : [];
|
||||||
fn = value => !!~list.indexOf(value);
|
fn = value => !!~list.indexOf(value);
|
||||||
} else if (directive === 'notIn') {
|
} else if (directive === 'notIn') {
|
||||||
let list:Array<any> = arg1 ? getStrOrVariable(arg1, this) : [];
|
let list: Array<any> = arg1 ? getStrOrVariable(arg1, this) : [];
|
||||||
list = Array.isArray(list) ? list : [];
|
list = Array.isArray(list) ? list : [];
|
||||||
fn = value => !~list.indexOf(value);
|
fn = value => !~list.indexOf(value);
|
||||||
} else {
|
} else {
|
||||||
@ -364,7 +364,7 @@ function getStrOrVariable(value: string, data: any) {
|
|||||||
? parseFloat(value)
|
? parseFloat(value)
|
||||||
: /,/.test(value)
|
: /,/.test(value)
|
||||||
? value.split(/\s*,\s*/)
|
? value.split(/\s*,\s*/)
|
||||||
: (resolveVariable(value, data) ?? value);
|
: resolveVariable(value, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function getConditionValue(
|
function getConditionValue(
|
||||||
|
Loading…
Reference in New Issue
Block a user