File tree 1 file changed +11
-10
lines changed
1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -61,17 +61,18 @@ export function resolveAsyncComponent (
61
61
const contexts = factory . contexts = [ context ]
62
62
let sync = true
63
63
64
- const forceRender = ( ) => {
64
+ const forceRender = ( renderCompleted : boolean ) => {
65
65
for ( let i = 0 , l = contexts . length ; i < l ; i ++ ) {
66
66
contexts [ i ] . $forceUpdate ( )
67
67
68
- const currContext = contexts [ i ]
69
- const contextIdx = contexts . indexOf ( currContext )
70
- if ( contextIdx >= 0 ) {
71
- currContext . $nextTick ( ( ) => {
72
- contexts . splice ( contextIdx , 1 )
73
- } )
68
+ if ( ! renderCompleted ) {
69
+ continue
74
70
}
71
+
72
+ const contextIdx = i
73
+ contexts [ i ] . $nextTick ( ( ) => {
74
+ contexts . splice ( contextIdx , 1 )
75
+ } )
75
76
}
76
77
}
77
78
@@ -81,7 +82,7 @@ export function resolveAsyncComponent (
81
82
// invoke callbacks only if this is not a synchronous resolve
82
83
// (async resolves are shimmed as synchronous during SSR)
83
84
if ( ! sync ) {
84
- forceRender ( )
85
+ forceRender ( true )
85
86
}
86
87
} )
87
88
@@ -92,7 +93,7 @@ export function resolveAsyncComponent (
92
93
)
93
94
if ( isDef ( factory . errorComp ) ) {
94
95
factory . error = true
95
- forceRender ( )
96
+ forceRender ( true )
96
97
}
97
98
} )
98
99
@@ -119,7 +120,7 @@ export function resolveAsyncComponent (
119
120
setTimeout ( ( ) => {
120
121
if ( isUndef ( factory . resolved ) && isUndef ( factory . error ) ) {
121
122
factory . loading = true
122
- forceRender ( )
123
+ forceRender ( false )
123
124
}
124
125
} , res . delay || 200 )
125
126
}
You can’t perform that action at this time.
0 commit comments