vue-scrollto icon indicating copy to clipboard operation
vue-scrollto copied to clipboard

Support :target pseudo-class

Open simonhermann opened this issue 6 years ago • 2 comments
trafficstars

Native page internal anchors add a hash to the url (like #section1), wich applies the :target pseudo class to the target element, and thus enables styling it. Would the same functionality be possible with vue-scrollto?

simonhermann avatar May 10 '19 08:05 simonhermann

You can hook into the onDone callback and use vue to toggle a class on any element.

rigor789 avatar May 10 '19 14:05 rigor789

We can also use location:

VueScrollTo.scrollTo(el, { onDone: () => location.replace('#section1') })

this will activate the :target Sorry for necro.

hey-red avatar Nov 24 '19 09:11 hey-red