[Vuejs]-Dynamic colour based on vue-route-link active

1👍

This approach is
– add a the selected class to the parent
– create css rule like

.red .nav--link__red {}
.blue .nav--link__blue {}
  • on click we set the parent class in that way we find selected item.

https://codepen.io/Ranushka/pen/ZEzjdrO

I’m realy new to vue.js so there can be better solution.

Leave a comment