Browse Source

Update index.tsx

lex 2 years ago
parent
commit
d7d76a4c3e
1 changed files with 4 additions and 3 deletions
  1. 4 3
      src/components/col-share/index.tsx

+ 4 - 3
src/components/col-share/index.tsx

@@ -63,13 +63,13 @@ export default defineComponent({
         .then(async canvas => {
           const url = canvas.toDataURL('image/png')
           this.image = url
-          setTimeout(() => {
-            this.saveLoading = false
-          }, 100)
           Toast.loading({
             message: '图片生成中...',
             forbidClick: true
           })
+          setTimeout(() => {
+            this.saveLoading = false
+          }, 100)
           const res = await promisefiyPostMessage({
             api: 'savePicture',
             content: {
@@ -84,6 +84,7 @@ export default defineComponent({
         })
         .catch(() => {
           Toast.clear()
+          this.saveLoading = false
         })
     },
     async shareShow() {