Vue知识点-改变路由的哈希模式(去掉路由中的#)

时间:2020-01-01 17:40:50   收藏:0   阅读:520

1、改变路由的哈希模式(在路由中会出现#):
  在src/router/index.js中

    创建路由对象:
      const routes = [

{path:"",redirect:"/home"},

{path:"/home",component:Home},

{path:"/cart",comsponent:Cart},

{path:"/profile",component:Profile},

{path:"/category",component:Cart},

]

 

const router  = new Vuerouter({

  routes,

  mode:‘history‘

})

export default router

 

将mode改为"history"

原文:https://www.cnblogs.com/jjbw/p/12129277.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!