diff --git a/src/utils/tpl-builtin.ts b/src/utils/tpl-builtin.ts index 86a6a0fb..901a90c6 100644 --- a/src/utils/tpl-builtin.ts +++ b/src/utils/tpl-builtin.ts @@ -244,11 +244,10 @@ export const filters: { ? RegExp.$2 : resolveVariable(arg1, this as any) : ''; - // 比对的值是空时直接返回。 - if (!arg1) { + if (arg1 !== undefined && arg1 !== null) { return input; } - fn = value => arg1 == value; + fn = value => arg1 === value; } else { if (directive !== 'match') { directive = 'match';