@dolphinweex/weex-vue-render 0.2.34 → 0.2.35

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.
@@ -2732,13 +2732,21 @@ function init$1 (viewportWidth) {
2732
2732
  var env = window.weex && window.weex.config.env;
2733
2733
  info.deviceHeight = env.deviceHeight = screenHeight * dpr;
2734
2734
  };
2735
+ // 一多适配不同宽高比例的屏幕,使用resetViewport也能适配宽度,
2736
+ // 但项目存在没有使用rem的元素,且页面高度重置方法也因项目而异。
2737
+ // 后续联合所有页面统一做了适配后可删除此段代码
2738
+ var resetDeviceWidth = function () {
2739
+ if(Math.abs(screenWidth-doc.documentElement.clientWidth) > 10){
2740
+ location.reload()
2741
+ }
2742
+ };
2735
2743
 
2736
2744
  // set root font for rem.
2737
2745
  setRootFont(screenWidth, viewportWidth);
2738
2746
  setMetaViewport(viewportWidth);
2739
2747
 
2740
2748
  // window.addEventListener('resize', resetDeviceHeight);
2741
-
2749
+ window.addEventListener('resize', resetDeviceWidth);
2742
2750
  /**
2743
2751
  * why not to use window.screen.width to get screenWidth ? Because in some
2744
2752
  * old webkit browser on android system it get the device pixel width, which
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.34"
52
+ "version": "0.2.35"
53
53
  }