[Vuejs]-How to trigger a function in vuejs after the page is loaded?

0👍

Rather than manipulating the DOM, you should use v-if on the element itself that turns it on or off based on data. It is a different way of thinking than direct DOM manipulation learned in the jQuery days. Read more in the Vue docs about conditional rendering.

If you are wanting to trigger once the DOM is available, use mounted()

Leave a comment