[Vuejs]-Waiting for the DOM to update in vue

0👍

Like Radeanu pointed out, I can just use setTimeout(). Because $nextTick() fires after an update in the virtual DOM, not in the real DOM. The code that I use now, that works, looks like this:

setTimeout( () => {
    // set it to zero, so that it animates
    this.menuStyles = { '--int-menu-height': 0 } 
}, 1);

Leave a comment