rkljw 1 month ago
parent
commit
48b873c82c
1 changed files with 8 additions and 0 deletions
  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);
       }