新页面打开执行日志.

This commit is contained in:
lijiahang
2024-03-21 19:20:37 +08:00
parent 31971b4e06
commit c7e520d34b
22 changed files with 214 additions and 84 deletions

View File

@@ -1,9 +1,11 @@
import type { RouteLocationRaw } from 'vue-router';
import { createRouter, createWebHistory } from 'vue-router';
import NProgress from 'nprogress';
import 'nprogress/nprogress.css';
import { appRoutes } from './routes';
import BASE_ROUTERS from './routes/base';
import createRouteGuard from './guard';
import { openWindow } from '@/utils';
import 'nprogress/nprogress.css';
NProgress.configure({ showSpinner: false });
@@ -22,4 +24,10 @@ const router = createRouter({
// 创建路由守卫
createRouteGuard(router);
// 新页面打开路由
export const openNewRoute = (route: RouteLocationRaw) => {
const { href } = router.resolve(route);
openWindow(href);
};
export default router;