您的位置:首页 > Web前端 > Vue.js

vue-router HTML5 History 模式

2018-08-20 10:21 561 查看

在webpack配置中,devserver配置如下:

devServer: {
clientLogLevel: 'warning',
historyApiFallback: {
rewrites: [
{ from: /.*/, to: path.posix.join(config.dev.assetsPublicPath, 'index.html') },
],
}
//其他的省略,暂未列出
}

vue-router配置

const router = new VueRouter({
mode: 'history',
routes: [...]
})
阅读更多
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: