@dolphinweex/weex-harmony 0.1.61 → 0.1.62
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.
package/package.json
CHANGED
package/src/.DS_Store
ADDED
|
Binary file
|
|
Binary file
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
<div>
|
|
3
3
|
<!-- <text v-if="progressText.length > 0">{{progressText}}</text> -->
|
|
4
4
|
<iframe
|
|
5
|
-
class="common-view-iframe"
|
|
6
5
|
:id="embedId"
|
|
7
6
|
v-if="url.length > 0 && pluginType != 'old-h5'"
|
|
8
7
|
:src="url"
|
|
@@ -124,14 +123,19 @@ export default {
|
|
|
124
123
|
};
|
|
125
124
|
this._wrapperEl = findWrapperFromParent(); // 保存容器引用
|
|
126
125
|
this._onMessage = (event) => {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
this._wrapperEl
|
|
126
|
+
if(event.data.type==='IFRAME_CONTENT_HEIGHT'){
|
|
127
|
+
const h = Number(event.data.height) || 0;
|
|
128
|
+
if (!h) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
if (this._wrapperEl) {
|
|
132
|
+
this._wrapperEl.style.height = `${h}px`;
|
|
133
|
+
}
|
|
134
|
+
this.height = `${h / weex.config.env.scale}px`;
|
|
135
|
+
return
|
|
136
|
+
}else{
|
|
137
|
+
document.getElementsByTagName('iframe')[0].height = event.data.height
|
|
133
138
|
}
|
|
134
|
-
this.height = `${h / weex.config.env.scale}px`;
|
|
135
139
|
};
|
|
136
140
|
window.addEventListener("message", this._onMessage, false);
|
|
137
141
|
},
|
|
@@ -152,7 +156,5 @@ export default {
|
|
|
152
156
|
</script>
|
|
153
157
|
|
|
154
158
|
<style scoped>
|
|
155
|
-
|
|
156
|
-
height: 100%;
|
|
157
|
-
}
|
|
159
|
+
|
|
158
160
|
</style>
|