perf: 优化nprogress进度条,页面重进或接口请求时不再显示进度条,提升用户体验 (#1225)

This commit is contained in:
xiaoming
2025-09-15 15:40:46 +08:00
committed by GitHub
parent c821f32ae9
commit 915e01c15c
4 changed files with 22 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
<script setup lang="ts">
import { $t } from "@/plugins/i18n";
import { emitter } from "@/utils/mitt";
import NProgress from "@/utils/progress";
import { RouteConfigs } from "../../types";
import { useTags } from "../../hooks/useTag";
import { routerArrays } from "@/layout/types";
@@ -206,12 +207,14 @@ function dynamicRouteTag(value: string): void {
/** 刷新路由 */
function onFresh() {
NProgress.start();
const { fullPath, query } = unref(route);
router.replace({
path: "/redirect" + fullPath,
query
});
handleAliveRoute(route as ToRouteType, "refresh");
NProgress.done();
}
function deleteDynamicTag(obj: any, current: any, tag?: string) {