实现路由高亮的两种形式

1、使用vue-router为我们提供好的类名,添加你想要的样式(例:router-link-exact-active     router-link-active)

2、在new的VueRouter实例身上进行修改

    var routes = new VueRouter({
      routes: [
        { path: '/', redirect: '/dlzj' },
        { path: '/dlzj', component: dlzj },
        { path: '/zczj', component: zczj }
      ],
      linkActiveClass: "leiming" //填写新的类名
    })
posted @ 2020-01-13 18:14  小小小~  阅读(341)  评论(0)    收藏  举报