File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -167,10 +167,16 @@ exports.rerender = tryWrap((id, options) => {
167
167
if ( Array . isArray ( instance . $options . cached ) ) {
168
168
instance . $options . cached = [ ]
169
169
}
170
+
170
171
// post 2.5.4: v-once trees are cached on instance._staticTrees.
171
172
// Pure static trees are cached on the staticRenderFns array
172
173
// (both already reset above)
174
+
175
+ // 2.6: temporarily mark rendered scoped slots as unstable so that
176
+ // child components can be forced to update
177
+ const restore = patchScopedSlots ( instance )
173
178
instance . $forceUpdate ( )
179
+ instance . $nextTick ( restore )
174
180
} )
175
181
} else {
176
182
// functional or no instance created yet
@@ -241,3 +247,17 @@ exports.reload = tryWrap((id, options) => {
241
247
}
242
248
} )
243
249
} )
250
+
251
+ // 2.6 optimizes template-compiled scoped slots and skips updates if child
252
+ // only uses scoped slots. We need to patch the scoped slots resolving helper
253
+ // to temporarily mark all scoped slots as unstable in order to force child
254
+ // updates.
255
+ function patchScopedSlots ( instance ) {
256
+ if ( ! instance . _u ) return
257
+ // https://github.com/vuejs/vue/blob/dev/src/core/instance/render-helpers/resolve-scoped-slots.js
258
+ const original = instance . _u
259
+ instance . _u = slots => original ( slots , true )
260
+ return ( ) => {
261
+ instance . _u = original
262
+ }
263
+ }
You can’t perform that action at this time.
0 commit comments