去除vue项目地址栏中的#

在router文件夹下的index.js中的router实例中添加mode属性,值设置为history

export default new Router({
  mode:"history",//去除哈希值的#号
  routes
})

 使用这种模式需要后端的配合,如果没有后端的配合在打包的时候页面会是空白的。一般还是使用hash模式

posted @ 2019-07-16 09:53  下一页2013  阅读(1546)  评论(0编辑  收藏  举报