@dolphinweex/weex-vue-render 0.2.23 → 0.2.24

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.
@@ -8811,6 +8811,7 @@ function getWeb (weex) {
8811
8811
  var this$1 = this;
8812
8812
 
8813
8813
  return createElement('iframe', {
8814
+ ref: 'childIframe',
8814
8815
  attrs: {
8815
8816
  'weex-type': 'web',
8816
8817
  src: this.currentSrc
@@ -8831,8 +8832,15 @@ function getWeb (weex) {
8831
8832
  catch (err) {
8832
8833
  dispatchNativeEvent(el, 'error', err);
8833
8834
  }
8835
+
8836
+ window.addEventListener('message', function(event){
8837
+ if (event.source === this.$refs.childIframe.contentWindow) {
8838
+ // 处理接收到的消息
8839
+ dispatchNativeEvent(el, 'message', event.data);
8840
+ }
8841
+ }, false);
8834
8842
  });
8835
- }
8843
+ },
8836
8844
  },
8837
8845
  staticClass: 'weex-web weex-el',
8838
8846
  staticStyle: extractComponentStyle(this)
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.23"
52
+ "version": "0.2.24"
53
53
  }