Skip to content

Instantly share code, notes, and snippets.

@alexpts
Created December 30, 2017 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexpts/c6258ded10c51ef70912635dfbf89ba2 to your computer and use it in GitHub Desktop.
Save alexpts/c6258ded10c51ef70912635dfbf89ba2 to your computer and use it in GitHub Desktop.
Async component vue
export default () => {
return {
component: new Promise((resolve, reject) => {
setTimeout(() => {
reject(new Error('Can`t create component'));
resolve({
template: "<div>1234444</div>",
name: 'appMain2',
});
}, 100);
}),
loading: {
template: "<div>loading</div>"
},
error: {
template: "<div>error async</div>"
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment