How to VueJS router-link active style

前端 未结 5 777
予麋鹿
予麋鹿 2020-12-07 12:16

My page currently has Navigation.vue component. I want to make the each navigation hover and active. The \'hover\' works but \'active\' doesn\'t.

This is how Na

5条回答
  •  伪装坚强ぢ
    2020-12-07 12:29

    As mentioned above by @Ricky vue-router automatically applies two active classes, .router-link-active and .router-link-exact-active, to the component.

    So, to change active link css use:

    .router-link-exact-active{
     //your desired design when link is clicked
    font-weight: 700;
    }
    

提交回复
热议问题