Browse Source

chore: fix page path (#211)

pull/213/head
yuyang 2 years ago
committed by GitHub
parent
commit
34c7ab1336
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      globals.d.ts
  2. 3
      src/router/index.js

2
globals.d.ts

@ -3,7 +3,7 @@ declare type ClassName = { [className: string]: any } | ClassName[] | string;
declare interface ImportMeta {
env: {
MODE: 'mock' | 'development' | 'test' | 'release';
MODE: 'mock' | 'development' | 'test' | 'release' | 'site';
};
}

3
src/router/index.js

@ -4,6 +4,8 @@ import baseRouters from './modules/base';
import componentsRouters from './modules/components';
import othersRouters from './modules/others';
const env = import.meta.env.MODE || 'development';
// 存放动态路由
export const asyncRouterList = [...baseRouters, ...componentsRouters, ...othersRouters];
@ -24,6 +26,7 @@ const defaultRouterList = [
const createRouter = () =>
new VueRouter({
mode: 'history',
base: env === 'site' ? '/starter/vue/' : null,
routes: defaultRouterList,
scrollBehavior() {
return { x: 0, y: 0 };

Loading…
Cancel
Save