File tree 2 files changed +8
-10
lines changed
2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,6 @@ module.exports = {
41
41
}
42
42
// component resolution related state
43
43
this . pendingComponentCb =
44
- this . componentID =
45
44
this . Component = null
46
45
// transition related state
47
46
this . pendingRemovals = 0
@@ -145,9 +144,8 @@ module.exports = {
145
144
146
145
resolveComponent : function ( id , cb ) {
147
146
var self = this
148
- this . pendingComponentCb = _ . cancellable ( function ( component ) {
149
- self . componentID = id
150
- self . Component = component
147
+ this . pendingComponentCb = _ . cancellable ( function ( Component ) {
148
+ self . Component = Component
151
149
cb ( )
152
150
} )
153
151
this . vm . _resolveComponent ( id , this . pendingComponentCb )
@@ -177,7 +175,7 @@ module.exports = {
177
175
178
176
build : function ( extraOptions ) {
179
177
if ( this . keepAlive ) {
180
- var cached = this . cache [ this . componentID ]
178
+ var cached = this . cache [ this . Component . cid ]
181
179
if ( cached ) {
182
180
return cached
183
181
}
@@ -201,7 +199,7 @@ module.exports = {
201
199
var parent = this . _host || this . vm
202
200
var child = parent . $addChild ( options , this . Component )
203
201
if ( this . keepAlive ) {
204
- this . cache [ this . componentID ] = child
202
+ this . cache [ this . Component . cid ] = child
205
203
}
206
204
return child
207
205
}
Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ describe('Async components', function () {
111
111
vm . view = 'view-b'
112
112
function step1 ( ) {
113
113
// called after A resolves, but A should have been
114
- // invalidated so not cotrId should be set
115
- expect ( vm . _directives [ 0 ] . componentID ) . toBe ( null )
114
+ // invalidated so no Ctor should be set
115
+ expect ( vm . _directives [ 0 ] . Component ) . toBe ( null )
116
116
}
117
117
function step2 ( ) {
118
118
// B should resolve successfully
@@ -145,8 +145,8 @@ describe('Async components', function () {
145
145
vm . $destroy ( )
146
146
function next ( ) {
147
147
// called after A resolves, but A should have been
148
- // invalidated so not cotrId should be set
149
- expect ( dir . componentID ) . toBe ( null )
148
+ // invalidated so no Ctor should be set
149
+ expect ( dir . Component ) . toBe ( null )
150
150
done ( )
151
151
}
152
152
} )
You can’t perform that action at this time.
0 commit comments