I am looking to create a Vue async component that stays in a loading state until a custom event is triggered. This means it will render a specified loading component until the event occurs.
Here's an example of how I want it to work:
const AsyncComponent = () => ({
component: () => new Promise( resolve => import('./MyComponent.vue')
.then(component => component.$emit.on('customLoadedEvent', resolve))
),
loading: LoadingComponent,
error: ErrorComponent,
delay: 200,
timeout: 3000
})
Is it possible to easily configure something like this?