File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -115,6 +115,9 @@ export default {
115
115
const slot = this . $slots . default
116
116
const vnode : VNode = getFirstComponentChild ( slot )
117
117
const componentOptions : ?VNodeComponentOptions = vnode && vnode . componentOptions
118
+ if ( vnode ) {
119
+ vnode . _cid = componentOptions . Ctor . cid ;
120
+ }
118
121
if (componentOptions) {
119
122
// check pattern
120
123
const name : ?string = getComponentName ( componentOptions )
@@ -135,10 +138,14 @@ export default {
135
138
? componentOptions.Ctor.cid + (componentOptions.tag ? `::${ componentOptions . tag } ` : '')
136
139
: vnode.key
137
140
if (cache[key]) {
138
- vnode . componentInstance = cache [ key ] . componentInstance
139
- // make current key freshest
140
- remove ( keys , key )
141
- keys . push ( key )
141
+ if ( vnode . _cid === cache [ key ] . _cid ) {
142
+ vnode . componentInstance = cache [ key ] . componentInstance ;
143
+ // make current key freshest
144
+ remove ( keys , key ) ;
145
+ keys . push ( key ) ;
146
+ } else {
147
+ cache [ key ] = vnode ;
148
+ }
142
149
} else {
143
150
// delay setting the cache until update
144
151
this . vnodeToCache = vnode
You can’t perform that action at this time.
0 commit comments