18 lines
589 B
TypeScript
18 lines
589 B
TypeScript
import { statisticRoutes } from '@/router/module/statisticRoutes';
|
||
import { createRouter, createWebHashHistory, createWebHistory } from 'vue-router';
|
||
import { pageRoutes } from './module/pageRoutes';
|
||
|
||
/**
|
||
* * 如果需要打包成app,则要将路由改为Hash路由,createWebHashHistory
|
||
* * 如果不需要 createWebHistory
|
||
*/
|
||
const router = createRouter({
|
||
history:
|
||
process.env.NODE_ENV === 'production'
|
||
? createWebHashHistory(import.meta.env.BASE_URL)
|
||
: createWebHistory(import.meta.env.BASE_URL),
|
||
routes: [...pageRoutes, ...statisticRoutes],
|
||
});
|
||
|
||
export default router;
|