Pārlūkot izejas kodu

Revert "去掉loading"

This reverts commit bc0fc72ba1790c9e69bac34b1dc5448d5918cbcb.
lex 2 gadi atpakaļ
vecāks
revīzija
d7e4bdd6c2
1 mainītis faili ar 11 papildinājumiem un 10 dzēšanām
  1. 11 10
      src/router/index.ts

+ 11 - 10
src/router/index.ts

@@ -42,9 +42,9 @@ const router: Router = createRouter({
 
 const whitePath = ['/coursewarePlay']
 router.beforeEach((to, from, next) => {
-  // if (!whitePath.includes(to.path)){
-  //   baseEvent.emit('toastShow')
-  // }
+  if (!whitePath.includes(to.path)){
+    baseEvent.emit('toastShow')
+  }
   // console.log(to, from)
   document.title = (to.meta.title || '管乐团') as any
   next()
@@ -52,13 +52,14 @@ router.beforeEach((to, from, next) => {
 
 router.afterEach((to, from) => {
   // 为了处理全屏弹窗loading没有关闭
-  // if (to.path === from.path) {
-  //   baseEvent.emit('toastClose')
-  // } else {
-  //   setTimeout(() => {
-  //     baseEvent.emit('toastClose')
-  //   }, 300);
-  // }
+  if (to.path === from.path) {
+    baseEvent.emit('toastClose')
+  } else {
+    setTimeout(() => {
+      // const toastStatus = baseEvent.emit('toastStatus')
+      baseEvent.emit('toastClose')
+    }, 300);
+  }
 })
 
 let isOpen = false