chore: 集成github pages发布环境

This commit is contained in:
张传龙
2022-04-09 22:29:11 +08:00
parent e7fc403c77
commit 17928cbc57
4 changed files with 20 additions and 14 deletions

View File

@@ -1,9 +1,10 @@
import { createRouter, createWebHistory } from 'vue-router'
import { createRouter, createWebHistory, createWebHashHistory } from 'vue-router'
import { setupRouterGuard } from './guard'
import { basicRoutes } from './routes'
const isHash = !!import.meta.env.VITE_APP_USE_HASH
export const router = createRouter({
history: createWebHistory('/'),
history: isHash ? createWebHashHistory('/') : createWebHistory('/'),
routes: basicRoutes,
scrollBehavior: () => ({ left: 0, top: 0 }),
})