feat: dynamic switching components

This commit is contained in:
Qiuxia Fan
2022-01-04 22:29:35 +08:00
parent 731aded68b
commit b9a6e648ae
6 changed files with 116 additions and 88 deletions

View File

@@ -21,7 +21,6 @@ export const routesGen: Array<RouteRecordRaw> = [
{
path: "",
name: "GeneralService",
redirect: "/generalService",
meta: {
title: "generalService",
icon: "chart",

View File

@@ -53,6 +53,10 @@ router.beforeEach((to, from, next) => {
}
(window as any).axiosCancel = [];
}
next();
if (to.path === "/") {
next({ path: "/generalService" });
} else {
next();
}
});
export default router;