From 1bc48f1743add1c97c82917503e51fb685626e31 Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Fri, 6 Mar 2020 17:43:52 +0800 Subject: [PATCH] =?UTF-8?q?equals=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/tpl-builtin.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/utils/tpl-builtin.ts b/src/utils/tpl-builtin.ts index 86a6a0fb0..901a90c61 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';