From d375051ec3a0f483a541e6577960f6f5279a6614 Mon Sep 17 00:00:00 2001 From: lyt <1105290566@qq.com> Date: Sat, 30 Apr 2022 00:26:46 +0800 Subject: [PATCH] =?UTF-8?q?'admin-22.04.30:=E4=BC=98=E5=8C=96=E9=A6=96?= =?UTF-8?q?=E5=B1=8F=E5=8A=A0=E8=BD=BDloading=E9=97=AE=E9=A2=98'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 +- src/layout/component/main.vue | 2 ++ src/router/index.ts | 2 -- src/utils/loading.ts | 22 +++++++++++----------- src/views/login/index.vue | 11 ++++++++--- 5 files changed, 22 insertions(+), 17 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9ade77..5463de4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ - 🎯 优化 图标选择器 [#I4YAHB](https://gitee.com/lyt-top/vue-next-admin/issues/I4YAHB),感谢[@真有你的](https://gitee.com/sunliusen) - 🎯 优化 图标选择器 icon type 类型为 all 时,类型 ali、ele、awe 回显问题 - 🎯 优化 去掉开发环境 i18n 控制台警告,页面代码:[i18n/index.ts](https://gitee.com/lyt-top/vue-next-admin/blob/master/src/i18n/index.ts) -- 🎯 优化 登录页添加 `NextLoading.start()` 方法,防止第一次进入界面时出现短暂空白 +- 🎯 优化 `NextLoading.start()` 方法,防止第一次进入界面时出现短暂空白 - 🎯 优化 地址栏有参数退出登录,再次登录不跳之前界面问题 `src/layout/navBars/breadcrumb/user.vue` - 🎯 优化 `SvgIcon` 组件,防止 `开启 Tagsview 图标` 时,`tagsView 右键菜单关闭` 报错问题 - 🎯 优化 [wangEditor](https://www.wangeditor.com/) 更新到 v5,[vue3 版本线上示例中 wangeditor 富文本编辑器 demo 实例,无法换行#I5565B](https://gitee.com/lyt-top/vue-next-admin/issues/I5565B),感谢@[jenchih](https://gitee.com/jenchih) diff --git a/src/layout/component/main.vue b/src/layout/component/main.vue index b88fda8..18eba60 100644 --- a/src/layout/component/main.vue +++ b/src/layout/component/main.vue @@ -24,6 +24,7 @@ import { defineComponent, toRefs, reactive, getCurrentInstance, watch, onMounted import { useRoute } from 'vue-router'; import { storeToRefs } from 'pinia'; import { useThemeConfig } from '/@/stores/themeConfig'; +import { NextLoading } from '/@/utils/loading'; import LayoutParentView from '/@/layout/routerView/parent.vue'; import Footer from '/@/layout/footer/index.vue'; @@ -65,6 +66,7 @@ export default defineComponent({ onMounted(async () => { await initGetMeta(); initHeaderHeight(); + NextLoading.done(); }); // 监听路由变化 watch( diff --git a/src/router/index.ts b/src/router/index.ts index 5f417c7..e7ed858 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -9,7 +9,6 @@ import { useTagsViewRoutes } from '/@/stores/tagsViewRoutes'; import { useRoutesList } from '/@/stores/routesList'; import { useThemeConfig } from '/@/stores/themeConfig'; import { Session } from '/@/utils/storage'; -import { NextLoading } from '/@/utils/loading'; import { staticRoutes, dynamicRoutes } from '/@/router/route'; import { initFrontEndControlRoutes } from '/@/router/frontEnd'; import { initBackEndControlRoutes } from '/@/router/backEnd'; @@ -259,7 +258,6 @@ router.beforeEach(async (to, from, next) => { // 路由加载后 router.afterEach(() => { NProgress.done(); - NextLoading.done(); }); // 导出路由 diff --git a/src/utils/loading.ts b/src/utils/loading.ts index 46675a2..c23fb77 100644 --- a/src/utils/loading.ts +++ b/src/utils/loading.ts @@ -14,18 +14,18 @@ export const NextLoading = { div.setAttribute('class', 'loading-next'); const htmls = `
`; div.innerHTML = htmls; bodys.insertBefore(div, bodys.childNodes[0]); diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 1f0f5c9..2eb3ed3 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -31,14 +31,15 @@