Slide 5
Slide 5 text
const AsyncComponent = () => ({
component: import('./MyComponent.vue'),
loading: LoadingComponent,
error: ErrorComponent,
// for loading component. Default 200ms
delay: 100,
// for error component. Default Infinity
timeout: 3000
})
Vue.component(
'async-webpack-example',
AsyncComponent
)
Idea and Concept
1. https://vuejs.org/v2/guide/components-dynamic-async.html
Async Components Step 2
© msg | May 2019 | Async Vue.js Components | Alexander Schwartz 5
• Vue.js will set timeouts for the alternative
components