瀏覽代碼

路由模式修改为hash模式

tongshangming 1 年之前
父節點
當前提交
47b0fb1084
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      src/router/index.ts

+ 3 - 3
src/router/index.ts

@@ -1,11 +1,11 @@
-import { createRouter, createWebHistory } from 'vue-router'
+import { createRouter, createWebHashHistory } from 'vue-router'
 import constantRouter from './constantRouter'
 import createRouterGuard from './guard'
 export { default as asyncRouter } from './asyncRouter'
 
 const router = createRouter({
-  history: createWebHistory(import.meta.env.BASE_URL),
-  routes: [...constantRouter]
+  history: createWebHashHistory(import.meta.env.BASE_URL),
+  routes: [...constantRouter],
 })
 
 createRouterGuard(router)