1

What is the correct technique to do this?

For example, If component A is in view, .router-link-active would point to the component A related router-link

But If i scroll further down the page, to Component B per say, .router-link-active would point to component B.

Aaron
  • 1,208
  • 1
  • 9
  • 21
  • You can test which nodes are within the viewport using https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API I have an example using it in this answer: https://stackoverflow.com/a/52460697/2766908 You can update the code in that example to fit your use-case, which would be to update your router links in the IntersectionObserver callback when certain components come into view. – pretzelhammer Sep 23 '18 at 05:02

0 Answers0