1

I have built a single page application using VueJS. There are multiple sections with IDs. In the header I have an <a> tag that links to the corresponding IDs in order to simulate a (sticky) header (-> the header is visible throughout the whole page)

I would like to highlight the current section that the user is looking at. Is there any convenient way (preferably using Vue) to get the nearest/visible/currently active section?

Schutt
  • 1,056
  • 6
  • 17
  • there are couple ways to highlight the current item. Please take a look at the [class and style binding in the documentation](https://vuejs.org/v2/guide/class-and-style.html#Object-Syntax) – wittgenstein Oct 27 '21 at 13:46
  • @Schutt checkout similar question https://stackoverflow.com/questions/69625784/router-link-in-vue-js-is-not-showing-active/69630074#69630074 – Jebasuthan Oct 27 '21 at 16:07

0 Answers0