vite_ts_auto/src/router/index.ts

18 lines
589 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;