跳转加loading

This commit is contained in:
zyn
2023-07-17 18:47:36 +08:00
parent 189dbe557f
commit efea9efffd
+3 -2
View File
@@ -63,6 +63,9 @@ import VConsole from 'vuex'
import isMobile from "./store/isMobile"; import isMobile from "./store/isMobile";
import { Loading } from 'element-ui'; import { Loading } from 'element-ui';
// 路由拦截
router.beforeEach(function (to, from, next) {
let loading = Loading.service({ let loading = Loading.service({
text: '加载中...', text: '加载中...',
background: '#fff' background: '#fff'
@@ -71,8 +74,6 @@ function closeLoading(){
loading.close() loading.close()
loading = null loading = null
} }
// 路由拦截
router.beforeEach(function (to, from, next) {
let fromName = from.name let fromName = from.name
if(fromName === undefined || fromName === null){ if(fromName === undefined || fromName === null){
window.sessionStorage.clear() window.sessionStorage.clear()