scroll window top vue code example
Example 1: scroll to top vue
methods: {
scrollToTop() {
window.scrollTo(0,0);
}
}
Example 2: scroll to top vue
<router-link @click.native="$scrollToTop">
methods: {
scrollToTop() {
window.scrollTo(0,0);
}
}
<router-link @click.native="$scrollToTop">