enhancer.js 681 Bytes
Newer Older
liang ce committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
function enhancer(Component) {
  return {
    mixins: [Component],
    updated: function updated() {
      var _this = this;

      this.$nextTick(function () {
        if (!_this.$refs.svgPathRef) {
          return;
        }
        var pathStyle = _this.$refs.svgPathRef.style;
        pathStyle.transitionDuration = '.3s, .3s, .3s, .06s';
        var now = Date.now();
        if (_this.prevTimeStamp && now - _this.prevTimeStamp < 100) {
          pathStyle.transitionDuration = '0s, 0s';
        }
        _this.prevTimeStamp = Date.now();
      });
    }
  };
}

exports['default'] = enhancer;