|
@@ -24,8 +24,7 @@
|
|
|
</category>
|
|
|
</xml>
|
|
|
</div>
|
|
|
- <iframe src="https://meta.cocorobo.cn" frameborder="0"></iframe>
|
|
|
-
|
|
|
+ <iframe src="https://meta.cocorobo.cn" frameborder="0" ref="unityvue"></iframe>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -56,6 +55,7 @@ export default {
|
|
|
return {
|
|
|
that: this,
|
|
|
workspace: null,
|
|
|
+ type: this.$route.query.type,
|
|
|
};
|
|
|
},
|
|
|
|
|
@@ -175,29 +175,36 @@ export default {
|
|
|
var _code = "police=1;";
|
|
|
return _code;
|
|
|
};
|
|
|
+ var that = this;
|
|
|
+ window.addEventListener("message", function (e) {
|
|
|
+ // 监听 message 事件
|
|
|
+ if (e.data.success) {
|
|
|
+ that.$refs.unityvue.contentWindow.postMessage({ type: that.type }, "*");
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<style>
|
|
|
-.abody{
|
|
|
+.abody {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
display: flex;
|
|
|
}
|
|
|
|
|
|
#blocklyDiv {
|
|
|
-width: 100%;
|
|
|
+ width: 100%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
-.ablockly{
|
|
|
+.ablockly {
|
|
|
width: 50%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
|
|
|
-.abody iframe{
|
|
|
- width: 50%;
|
|
|
+.abody iframe {
|
|
|
+ width: 50%;
|
|
|
height: 100%;
|
|
|
}
|
|
|
|