MCPcopy Create free account
hub / github.com/keepfool/vue-tutorials / applyTransition

Function applyTransition

06.Router/basic/js/vue.js:1090–1108  ·  view source on GitHub ↗

* Apply transitions with an operation callback. * * @param {Element} el * @param {Number} direction * 1: enter * -1: leave * @param {Function} op - the actual DOM operation * @param {Vue} vm * @param {Function} [cb]

(el, direction, op, vm, cb)

Source from the content-addressed store, hash-verified

1088 */
1089
1090 function applyTransition(el, direction, op, vm, cb) {
1091 var transition = el.__v_trans;
1092 if (!transition ||
1093 // skip if there are no js hooks and CSS transition is
1094 // not supported
1095 !transition.hooks && !transitionEndEvent ||
1096 // skip transitions for initial compile
1097 !vm._isCompiled ||
1098 // if the vm is being manipulated by a parent directive
1099 // during the parent's compilation phase, skip the
1100 // animation.
1101 vm.$parent && !vm.$parent._isCompiled) {
1102 op();
1103 if (cb) cb();
1104 return;
1105 }
1106 var action = direction > 0 ? 'enter' : 'leave';
1107 transition[action](op, cb);
1108 }
1109
1110var transition = Object.freeze({
1111 appendWithTransition: appendWithTransition,

Callers 4

appendWithTransitionFunction · 0.70
beforeWithTransitionFunction · 0.70
removeWithTransitionFunction · 0.70
vue.jsFile · 0.70

Calls 1

cbFunction · 0.70

Tested by

no test coverage detected