rkljw 1 개월 전
부모
커밋
48b873c82c
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      src/views/news/creatNews.vue

+ 8 - 0
src/views/news/creatNews.vue

@@ -448,6 +448,10 @@ export default {
         if(this.checked){
           inputLists.push(allowList);
         }
+        if(inputLists.length<3){
+          this.$message.error('投票答案必须大于2条');
+          return;
+        }
         this.form.suvey_array = JSON.stringify(inputLists);
       }
       // console.log('提交的数据:', this.inputList.map(input => input.value));
@@ -652,6 +656,10 @@ export default {
         if(this.checked){
           inputLists.push(allowList);
         }
+        if(inputLists.length<3){
+          this.$message.error('投票答案必须大于2条');
+          return;
+        }
         this.form.suvey_array = JSON.stringify(inputLists);
       }