Vue访问去掉url地址栏中的#符号

要去掉Vue访问地址中的#符号可以在路由中设置路由模式mode为history

export default new Router({
  mode: 'history',
  routes: [{
      path: '/',
      name: 'Home',
      component: Home
    }, {
      path: '/news',
      name: 'News',
      component: News
    }, {
      path: '/goods',
      name: 'Goods',
      component: Goods
    }, {
      path: '/detail/:id',
      name: 'Detail',
      component: Detail
    }
  ]
})
上一篇 vue-cli域名访问Invalid Host header
下一篇 Vue设置路由History mode模式,打包vue run build后访问404问题
目录
文章列表
1 Spring Security OAuth2 token存储Redis用户登出logOut
Spring Security OAuth2 token存储Redis用户登出logOut
2
Linux下查看磁盘占用空间
Linux下查看磁盘占用空间
3
设计模式(14)迭代器模式
设计模式(14)迭代器模式
4
微信小程序自定义radio和checkbox样式
微信小程序自定义radio和checkbox样式
5
SSH携带密码登录sshpass
SSH携带密码登录sshpass
最新评论
一位WordPress评论者
一位WordPress评论者
2月12日
您好,这是一条评论。若需要审核、编辑或删除评论,请访问仪表盘的评论界面。评论者头像来自 Gravatar。