Categories

1 Answer

Oct 9, 2019

In large applications, we may need to divide the app into smaller chunks and only load a component from the server when it’s needed. To make that easier, Vue allows you to define our component as a factory function that asynchronously resolves your component definition. Vue will only trigger the factory function when the component needs to be rendered and will cache the result for future re-renders. For example:

As we can see, the factory function receives a resolve callback, which should be called when we have retrieved your component definition from the server. We can also call reject(reason) to indicate the load has failed.

Click here to read more about Vue JS
Click here to read more about Insurance

Related questions

Madanswer
Oct 9, 2019 in Vue.JS
Oct 9, 2019 in Vue.JS
Oct 7, 2019 in Vue.JS
...