实现路由高亮的两种形式

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" //填写新的类名
    })

猜你喜欢

转载自www.cnblogs.com/Progress-/p/12188669.html