vue切换路由模式{hash/history}

vue中常用的路由模式

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

  • histroy(/)切换路由模式

切换路由模式

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

})

 

posted @ 2018-08-20 16:37  会说话的mao  阅读(5617)  评论(0编辑  收藏  举报