Преглед изворни кода

渠道客诉填写任务增加上传照片功能

zhujindu пре 11 месеци
родитељ
комит
d356a944e9
1 измењених фајлова са 7 додато и 4 уклоњено
  1. 7 4
      src/components/uploadImgVStorec.vue

+ 7 - 4
src/components/uploadImgVStorec.vue

@@ -52,7 +52,8 @@ export default {
       type: Object,
       default: {},
     },
-    required: {
+    isRequired: {
+      // 是否开启拍照前校验
       type: Boolean,
       default: true,
     },
@@ -68,9 +69,11 @@ export default {
       ImagePreview([val]);
     },
     uploadImg() {
-      if (required && localStorage.getItem('chainName') == null) {
-        this.$toast('请输入名称!');
-        return;
+      if (this.required) {
+        if (localStorage.getItem('chainName') == null) {
+          this.$toast('请输入名称!');
+          return;
+        }
       }
       let url = window.location.href;
       let that = this;