Commit a9cfe35f8304c1b8dcff8889c011c1245ce4fea2

Authored by fengtao
1 parent e4a7ba8c

refactor 优化图片上传再次点击显示loading

@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 > 13 >
14 <img v-if="devicePic" :src="devicePic" alt="avatar" /> 14 <img v-if="devicePic" :src="devicePic" alt="avatar" />
15 <div v-else> 15 <div v-else>
16 - <loading-outlined v-if="loading"></loading-outlined> 16 + <LoadingOutlined v-if="loading" />
17 <PlusOutlined v-else /> 17 <PlusOutlined v-else />
18 <div class="ant-upload-text">图片上传</div> 18 <div class="ant-upload-text">图片上传</div>
19 </div> 19 </div>
@@ -143,6 +143,7 @@ @@ -143,6 +143,7 @@
143 // 图片上传 143 // 图片上传
144 async function customUpload({ file }) { 144 async function customUpload({ file }) {
145 if (beforeUpload(file)) { 145 if (beforeUpload(file)) {
  146 + devicePic.value = '';
146 loading.value = true; 147 loading.value = true;
147 const formData = new FormData(); 148 const formData = new FormData();
148 formData.append('file', file); 149 formData.append('file', file);