Search code examples
vue.jsvuejs2vuetify.js

vue application hook for initial load


We have an application loader that is meant to be displayed when initially loading the application.

My solution was to hook into the 'mounted' hook of the layout, since all pages share the same layout.

I'm wondering if there's a better way to do this, as it seems like this is retriggered when switching back to the tab after it has been inactive for awhile.


Solution

  • Place your load screen inside the main app element. The content is replaced by Vue during the first render.

    <div id='app'>
      <h5>App is loading!</h5>
    </div>