Commit a9cfe35f8304c1b8dcff8889c011c1245ce4fea2

Authored by fengtao
1 parent e4a7ba8c

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

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