[Vuejs]-Vue Webpack load code splitting file and show loader

0👍

Dynamic imports return a promise so you should be able to do something along the lines of:

Dashboard.then(() => {
    // Remove your spinner or loading animation.
})

Before the import you would always show your spinner and in your then resolve, you would remove it.

Haven’t worked that much with dynamic import so this might not work.

Leave a comment