admin管理员组文章数量:1633912
由于业务需要,需要使用到多页面,最近在多页面中路由跳转遇到了一个问题:
1、有index.html、exchange.html两个模板文件,分别对应两个入口,vue.config.js配置如下// 配置多页面入口
pages: {
index: {
entry: 'src/main.js',
template: 'public/index.html',
filename: 'index.html',
title: 'Index Page',
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
exchange: {
entry: 'src/exchange_main.js',
title: 'exchange page',
template: 'public/exchange.html',
filename: 'exchange.html',
}
},
2、index入口对应的路由访问地址为:http://localhost:8088/#/xxx;
exchange入口对应的路由访问地址为:http://localhost:8088/exchange.html#/xxx
3、问题来了,当我在http://localhost:8088/exchange.html#/xxx页面中需要回到http://localhost:8088/#/xxx页面时,使用组件来访问就变成这样了:
在http://localhost:8088/exchange.html#/exchange中我想回到首页,于是路由这样写:
首页,然后就变成上面这样了,这就导致我不能正确的回到首页。
我现在的做法是使用a标签来进行访问,如:首页,但如果页面中有很多要跳转的地方那就很麻烦了
请问各位大神有没有更好的办法呢?
版权声明:本文标题:vue同一路由控制不同页面跳转_vue多页面路由相互跳转问题? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://m.elefans.com/dianzi/1729176304a1188760.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论