!82 修复 DictTag组件,当未找到匹配的数据时,不会显示value

Merge pull request !82 from lee/bugfix/DictTag_Unmatch
This commit is contained in:
疯狂的狮子Li 2024-01-18 09:39:29 +00:00 committed by Gitee
commit fdf885c261
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -50,12 +50,13 @@ const values = computed(() => {
const unmatch = computed(() => { const unmatch = computed(() => {
if (props.options?.length == 0 || props.value === '' || props.value === null || typeof props.value === 'undefined') return false; if (props.options?.length == 0 || props.value === '' || props.value === null || typeof props.value === 'undefined') return false;
// //
let unmatch = false; //
values.value.forEach((item) => { values.value.forEach((item) => {
if (!props.options.some((v) => v.value === item)) { if (!props.options.some((v) => v.value === item)) {
return true; // true unmatch = true; // true
} }
}); });
return false; // return unmatch; //
}); });
const unmatchArray = computed(() => { const unmatchArray = computed(() => {