#
号,在后台管理类的项目中并不影响使用,但是在特殊场景,比如微信分享的H5链接中,微信会自动拼接参数,由于 #
的原因,路径中会出现两段由 ?
拼接的部分,为避免这种情况,形成较为规范的 url 形式,可以采用 history 模式// 路由文件 index.js
const router = new VueRouter({
mode: ‘history‘,
base: ‘/aa/‘,
routes
})
// vue.config.js
module.exports = {
publicPath: ‘/aa/‘, // 基本路径
}
www.xxxx.com/aa/
,如果是根目录,直接写为 /
原文:https://www.cnblogs.com/NorthHarbor/p/12550605.html