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

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

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

相关文章: