style: 💄 代碼統一格式化

Former-commit-id: 7639f722803b80a3e1391f9652430d8e759e1a64
This commit is contained in:
郝先瑞
2023-04-18 23:16:13 +08:00
parent dcf30a7793
commit 5efbfab47b
7 changed files with 119 additions and 115 deletions

View File

@@ -1,50 +1,50 @@
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
export const Layout = () => import('@/layout/index.vue');
export const Layout = () => import("@/layout/index.vue");
// 静态路由
export const constantRoutes: RouteRecordRaw[] = [
{
path: '/redirect',
path: "/redirect",
component: Layout,
meta: { hidden: true },
children: [
{
path: '/redirect/:path(.*)',
component: () => import('@/views/redirect/index.vue')
}
]
path: "/redirect/:path(.*)",
component: () => import("@/views/redirect/index.vue"),
},
],
},
{
path: '/login',
component: () => import('@/views/login/index.vue'),
meta: { hidden: true }
path: "/login",
component: () => import("@/views/login/index.vue"),
meta: { hidden: true },
},
{
path: '/',
path: "/",
component: Layout,
redirect: '/dashboard',
redirect: "/dashboard",
children: [
{
path: 'dashboard',
component: () => import('@/views/dashboard/index.vue'),
name: 'Dashboard',
meta: { title: 'dashboard', icon: 'homepage', affix: true }
path: "dashboard",
component: () => import("@/views/dashboard/index.vue"),
name: "Dashboard",
meta: { title: "dashboard", icon: "homepage", affix: true },
},
{
path: '401',
component: () => import('@/views/error-page/401.vue'),
meta: { hidden: true }
path: "401",
component: () => import("@/views/error-page/401.vue"),
meta: { hidden: true },
},
{
path: '404',
component: () => import('@/views/error-page/404.vue'),
meta: { hidden: true }
}
]
}
path: "404",
component: () => import("@/views/error-page/404.vue"),
meta: { hidden: true },
},
],
},
// 外部链接
/*{
@@ -106,14 +106,14 @@ const router = createRouter({
history: createWebHashHistory(),
routes: constantRoutes as RouteRecordRaw[],
// 刷新时,滚动条位置还原
scrollBehavior: () => ({ left: 0, top: 0 })
scrollBehavior: () => ({ left: 0, top: 0 }),
});
/**
* 重置路由
*/
export function resetRouter() {
router.replace({ path: '/login' });
router.replace({ path: "/login" });
location.reload();
}