@dolphinweex/weex-vue-render 0.2.73 → 0.2.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9222,7 +9222,17 @@ var slider$1 = {
9222
9222
  watch: {
9223
9223
  index: function index () {
9224
9224
  this.currentIndex = this._normalizeIndex(this.index);
9225
- }
9225
+ this.currentIndex = this._normalizeIndex(this.index);
9226
+ // 如果正在滑动,强制打断并重置状态
9227
+ if (this._sliding) {
9228
+ var inner = this.$refs.inner;
9229
+ if (inner) {
9230
+ inner.style.transition = 'none';
9231
+ }
9232
+ this._sliding = false;
9233
+ }
9234
+ this._slideTo(this.currentIndex);
9235
+ }
9226
9236
  },
9227
9237
 
9228
9238
  data: function data () {
@@ -11009,21 +11019,36 @@ function transitionOnce (vnode, config, callback) {
11009
11019
  var dom = vnode instanceof HTMLElement ? vnode : vnode.$el;
11010
11020
  // trigger image lazyloading by force.
11011
11021
  dom && weex.utils.fireLazyload(dom, true);
11012
-
11013
- var transitionEndHandler = function (event) {
11014
- event && event.stopPropagation();
11022
+
11023
+ var ended = false;
11024
+ var cleanup = function () {
11025
+ if (ended) { return }
11026
+ ended = true;
11015
11027
  if (endEvent) {
11016
11028
  dom.removeEventListener(endEvent, transitionEndHandler);
11029
+ }
11030
+ if (styleName) {
11017
11031
  dom.style[styleName] = '';
11018
11032
  }
11033
+ };
11034
+ var transitionEndHandler = function (event) {
11035
+ event && event.stopPropagation();
11036
+ clearTimeout(timerId);
11037
+ cleanup();
11019
11038
  setTimeout(()=>{
11020
- callback(); //解决嵌套animation的时候 duration过小时会出现瞬间执行完毕的问题
11039
+ callback && callback(); // 兼容嵌套动画
11021
11040
  })
11022
11041
  };
11023
11042
  if (endEvent) {
11024
11043
  dom.style[styleName] = transitionValue;
11025
- dom.addEventListener(endEvent, transitionEndHandler);
11044
+ dom.addEventListener(endEvent, transitionEndHandler);
11026
11045
  }
11046
+ var totalMs = (duration + delay) + 60; // 兜底计时器,避免不触发 transitionend 时卡死
11047
+ var timerId = setTimeout(function () {
11048
+ if (ended) { return }
11049
+ cleanup();
11050
+ callback && callback();
11051
+ }, totalMs);
11027
11052
  nextFrame(function () {
11028
11053
  // 修改 transform:translate让它支持传3个参数,且第三个参数无效
11029
11054
  if (config.styles["transform"]) {
package/package.json CHANGED
@@ -49,5 +49,5 @@
49
49
  "type": "git",
50
50
  "url": "git+ssh://git@github.com/weexteam/weex-vue-render.git"
51
51
  },
52
- "version": "0.2.73"
52
+ "version": "0.2.75"
53
53
  }