[Vuejs]-How to run code immediately when element gets rendered upon satisfying v-show condition?

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
});

Leave a comment