1👍
If you’re showing an element and then wanting to scroll to it, you could try using the nextTick
callback:
// Set data that will show other element, i.e.
// this.showOtherElement = true;
// Use nextTick callback to scroll to element in the next tick
this.$nextTick().then(() => {
// Put code to scroll to element here
});
- [Vuejs]-Vuejs: how to use component 2 in template of component 1
- [Vuejs]-Vuejs avoid changing data in production mode by using DOM
Source:stackexchange.com