兰宝车间质量管理系统-前端
文兵 李
2024-01-15 0c56f87e06a62c4c9e5d4c3a5ebc4ec139ab924e
foreach中return并不会使其跳出循环,导致这个计算属性一直都会是false
已修改1个文件
5 ■■■■■ 文件已修改
src/components/DictTag/index.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/DictTag/index.vue
@@ -50,12 +50,13 @@
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(() => {