当前位置: 移动技术网 > IT编程>网页制作>CSS > 去掉vue路由中的#号

去掉vue路由中的#号

2018年09月27日  | 移动技术网IT编程  | 我要评论

市民白云观打钱眼,黑山谷两日游,dj现场版

去掉vue路由中的#号

在使用vue进行开发的时候我们会发现地址栏上的ip后面会跟着一个#号,如果想去掉这个井号,我们可以在路由上加上mode: 'history', 即可去掉,是不是很简单呢
export default new router({
  mode: 'history',
  routes: [
    {
      path: '/', 
      name: 'home',
      component: home
    },
    {
      path: '/home',
      name: 'home',
      component: home,
    },
    {
      path: '/details/:id',
      name: 'details',
      component: details,
      props:true
    },
    {
      path: '/post_blog',
      name: 'post_blog',
      component: postblog,
    },
    
  ]
})

如对本文有疑问,请在下面进行留言讨论,广大热心网友会与你互动!! 点击进行留言回复

相关文章:

验证码:
移动技术网