Tutorialsplane

Vue.js scroll to bottom of div


Vue.js scroll to bottom of div : We can use .scrollTop to scroll to bottom of div. Let us understand how we can do it.


Vue.js scroll to bottom of div Example

You can scroll to bottom of any div in vue.js simply as below-

Vue.js scroll to bottom of div Example:

var divContainer = this.$el.querySelector("#divId");
divContainer.scrollTop = divContainer.scrollHeight;