vue中常用的路由模式

  • hash(#):默认路由模式

  • histroy(/)切换路由模式

切换路由模式

export default new Router({
    // 路由模式:hash(默认),history模式
    mode: 'history',
    // 修改路由高亮样式,默认值为'router-link-active'
    linkActiveClass: 'active'
    //路由规则
    routes:[
        {
            path:'/',
            name:'index',
            component:'Index'
        }
    ],

})

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-25
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2021-09-05
  • 2021-12-10
  • 2022-12-23
  • 2021-09-05
  • 2022-12-23
相关资源
相似解决方案