Sfoglia il codice sorgente

fix: 上传进度100的时候,不显示取消上传

sgc 2 settimane fa
parent
commit
0cc001542d
1 ha cambiato i file con 9 aggiunte e 4 eliminazioni
  1. 9 4
      src/components/popupLoading/index.vue

+ 9 - 4
src/components/popupLoading/index.vue

@@ -34,10 +34,12 @@
           {{ title }}
         </p>
       </div>
-      <div class="pl-divider" />
-      <button type="button" class="pl-cancel" @click="onCancel">
-        <span class="pl-cancel__text">{{ cancelText }}</span>
-      </button>
+      <template v-if="showCancel">
+        <div class="pl-divider" />
+        <button type="button" class="pl-cancel" @click="onCancel">
+          <span class="pl-cancel__text">{{ cancelText }}</span>
+        </button>
+      </template>
     </div>
   </div>
 </template>
@@ -75,6 +77,9 @@ const displayPercent = computed(() => {
   return Math.round(Math.min(100, Math.max(0, n)));
 });
 
+/** 进度到 100% 后不再允许取消(上传/审核已结束) */
+const showCancel = computed(() => displayPercent.value < 100);
+
 /** SVG 环形:与 Element 主题色对齐 */
 const vb = 100;
 const cx = vb / 2;