소스 검색

限制可选个数

lifanagju_citu 11 달 전
부모
커밋
1a867fe2dd
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/components/industryTypeCard/index.vue

+ 1 - 1
src/components/industryTypeCard/index.vue

@@ -76,7 +76,7 @@ const handleClick = (val) => {
   const isExist = idChecked.value.includes(val.id)
   if (!isExist) {
     // 添加
-    if (props.limit === currentSelect.value.length) return Snackbar.warning(`最多可选${props.limit}个行业`)
+    if (props.limit === idChecked.value.length) return Snackbar.warning(`最多可选${props.limit}个行业`)
     currentSelect.value.push(val)
     idChecked.value.push(val.id)
   } else {