chenrui vor 9 Monaten
Ursprung
Commit
383aebabf5

+ 7 - 2
src/views/easyPassManagement/shoppingManagement/addCategoryModal.vue

@@ -24,7 +24,7 @@
           <Upload
             class="upload"
             id="add-category-iconUrl"
-            v-model="form.iconUrl"
+            v-model.trim="form.iconUrl"
             ref="imageSet"
             :fileSize="10"
             :maxNums="1"
@@ -112,7 +112,12 @@ export default {
   methods: {
     //  图片上传
     changeImage (file) {
-      this.form.iconUrl = file || ''
+      this.form.iconUrl = file
+      if (file) {
+        this.$nextTick(() => {
+          this.$refs.ruleForm.clearValidate('iconUrl')
+        })
+      }
     },
     //  保存
     handleSave () {