From ce275d9590e2389cf4db5f6f84177173926b6a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=B0=8F=E7=8E=8B=E5=AD=90?= Date: Tue, 5 Mar 2024 16:39:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DDictTag=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DictTag/index.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/DictTag/index.vue b/src/components/DictTag/index.vue index b355a42..7442546 100644 --- a/src/components/DictTag/index.vue +++ b/src/components/DictTag/index.vue @@ -50,12 +50,13 @@ const values = computed(() => { const unmatch = computed(() => { if (props.options?.length == 0 || props.value === '' || props.value === null || typeof props.value === 'undefined') return false; // 传入值为非数组 + let unmatch = false; // 添加一个标志来判断是否有未匹配项 values.value.forEach((item) => { if (!props.options.some((v) => v.value === item)) { - return true; // 如果有未匹配项,将标志设置为true + unmatch = true; // 如果有未匹配项,将标志设置为true } }); - return false; // 返回标志的值 + return unmatch; // 返回标志的值 }); const unmatchArray = computed(() => {