[Vuejs]-How to control the vertical scroll bar of a v-card?

0๐Ÿ‘

โœ…

You can select your element and then force scroll it up

// Get element
let obj = document.getElementByID("yourElementID");
// Set scroll position to 0 (top) 
obj.scrollTop = 0;

See https://www.w3schools.com/jsref/prop_element_scrolltop.asp for more infos

You can also select the element with VueJS $refs if you want : https://v2.vuejs.org/v2/api/#vm-refs

0๐Ÿ‘

On your pagination click just write the following function code:

scrollToTop() {
    window.scrollTo(0,0);
}

Leave a comment