fix(vue-app): don't attach catch handler to already loaded component (fixes #5751) (#5752)

This commit is contained in:
Rafał Chłodnicki 2019-05-16 21:31:12 +02:00 committed by Pooya Parsa
parent f391e5d331
commit 5d5a32b556

View File

@ -85,7 +85,10 @@ export default {
const Components = this.getPrefetchComponents()
for (const Component of Components) {
Component().catch(() => {})
const componentOrPromise = Component()
if (componentOrPromise instanceof Promise) {
componentOrPromise.catch(() => {})
}
Component.__prefetched = true
}<% if (router.linkPrefetchedClass) { %>
this.addPrefetchedClass()<% } %>