router默认hash
Showing
1 changed file
with
2 additions
and
2 deletions
| ... | @@ -13,8 +13,8 @@ Vue.use(Router) | ... | @@ -13,8 +13,8 @@ Vue.use(Router) |
| 13 | 13 | ||
| 14 | const createRouter = () => | 14 | const createRouter = () => |
| 15 | new Router({ | 15 | new Router({ |
| 16 | mode: 'history', | 16 | // mode: 'history', // 如果你是 history模式 需要配置vue.config.js publicPath |
| 17 | base: process.env.BASE_URL, | 17 | // base: process.env.BASE_URL, |
| 18 | scrollBehavior: () => ({ y: 0 }), | 18 | scrollBehavior: () => ({ y: 0 }), |
| 19 | routes: constantRouterMap | 19 | routes: constantRouterMap |
| 20 | }) | 20 | }) | ... | ... |
-
Please register or sign in to post a comment