Skip to content

Commit 507d1aa

Browse files
committed
small tweaks
1 parent f48b0c8 commit 507d1aa

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/directives/component.js

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,20 +40,19 @@ module.exports = {
4040
this.template = _.extractContent(this.el, true)
4141
}
4242
// component resolution related state
43-
this._pendingCb =
43+
this.pendingComponentCb =
4444
this.componentID =
4545
this.Component = null
46+
// transition related state
47+
this.pendingRemovals = 0
48+
this.pendingRemovalCb = null
4649
// if static, build right now.
4750
if (!this._isDynamicLiteral) {
4851
this.resolveComponent(this.expression, _.bind(this.initStatic, this))
4952
} else {
5053
// check dynamic component params
5154
this.transMode = this._checkParam('transition-mode')
5255
}
53-
54-
this.pendingRemovals = 0
55-
this.pendingRemovalCb = null
56-
5756
} else {
5857
process.env.NODE_ENV !== 'production' && _.warn(
5958
'cannot mount component "' + this.expression + '" ' +
@@ -132,12 +131,12 @@ module.exports = {
132131

133132
resolveComponent: function (id, cb) {
134133
var self = this
135-
this._pendingCb = _.cancellable(function (component) {
134+
this.pendingComponentCb = _.cancellable(function (component) {
136135
self.componentID = id
137136
self.Component = component
138137
cb()
139138
})
140-
this.vm._resolveComponent(id, this._pendingCb)
139+
this.vm._resolveComponent(id, this.pendingComponentCb)
141140
},
142141

143142
/**
@@ -147,9 +146,9 @@ module.exports = {
147146
*/
148147

149148
invalidatePending: function () {
150-
if (this._pendingCb) {
151-
this._pendingCb.cancel()
152-
this._pendingCb = null
149+
if (this.pendingComponentCb) {
150+
this.pendingComponentCb.cancel()
151+
this.pendingComponentCb = null
153152
}
154153
},
155154

@@ -221,7 +220,7 @@ module.exports = {
221220
// we may have a component switch when a previous
222221
// component is still being transitioned out.
223222
// we want to trigger only one lastest insertion cb
224-
// when the existing transition finishes.
223+
// when the existing transition finishes. (#1119)
225224
this.pendingRemovals++
226225
this.pendingRemovalCb = cb
227226
var self = this

0 commit comments

Comments
 (0)