今天vue打包文件遇到的问题:
vue打包后index访问的是首页,而非登录页面,在对router.beforeEach做了全局路由配置
排查各种原因。。。最后发现是router里模式配置成了history模式
let router = new Router({
saveScrollPosition: true,
scrollBehavior: () => ({
y: 0
}),
mode: 'hash'
});
修改history为hash后访问正确。
今天vue打包文件遇到的问题:
vue打包后index访问的是首页,而非登录页面,在对router.beforeEach做了全局路由配置
排查各种原因。。。最后发现是router里模式配置成了history模式
let router = new Router({
saveScrollPosition: true,
scrollBehavior: () => ({
y: 0
}),
mode: 'hash'
});
修改history为hash后访问正确。
本文标题:vue打包后index访问的是首页,而非登录页面
本文链接:https://www.haomeiwen.com/subject/ufkapftx.html
网友评论