Created
December 30, 2017 17:29
-
-
Save alexpts/c6258ded10c51ef70912635dfbf89ba2 to your computer and use it in GitHub Desktop.
Async component vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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