* A Transition object that encapsulates the state and logic * of the transition. * * @param {Element} el * @param {String} id * @param {Object} hooks * @param {Vue} vm
(el, id, hooks, vm)
| 6491 | * @param {Vue} vm |
| 6492 | */ |
| 6493 | function Transition(el, id, hooks, vm) { |
| 6494 | this.id = id; |
| 6495 | this.el = el; |
| 6496 | this.enterClass = hooks && hooks.enterClass || id + '-enter'; |
| 6497 | this.leaveClass = hooks && hooks.leaveClass || id + '-leave'; |
| 6498 | this.hooks = hooks; |
| 6499 | this.vm = vm; |
| 6500 | // async state |
| 6501 | this.pendingCssEvent = this.pendingCssCb = this.cancel = this.pendingJsCb = this.op = this.cb = null; |
| 6502 | this.justEntered = false; |
| 6503 | this.entered = this.left = false; |
| 6504 | this.typeCache = {}; |
| 6505 | // check css transition type |
| 6506 | this.type = hooks && hooks.type; |
| 6507 | /* istanbul ignore if */ |
| 6508 | if ('development' !== 'production') { |
| 6509 | if (this.type && this.type !== TYPE_TRANSITION && this.type !== TYPE_ANIMATION) { |
| 6510 | warn('invalid CSS transition type for transition="' + this.id + '": ' + this.type, vm); |
| 6511 | } |
| 6512 | } |
| 6513 | // bind |
| 6514 | var self = this;['enterNextTick', 'enterDone', 'leaveNextTick', 'leaveDone'].forEach(function (m) { |
| 6515 | self[m] = bind(self[m], self); |
| 6516 | }); |
| 6517 | } |
| 6518 | |
| 6519 | var p$1 = Transition.prototype; |
| 6520 |