Browse Source

嵌入

shibei_master
dai 3 years ago
parent
commit
3b3bc96ec5
  1. 29
      src/views/main-shuju/main-content.vue

29
src/views/main-shuju/main-content.vue

@ -11,17 +11,16 @@
'&customerId=' +
customerId
"
ref="iframes"
ref="iframe"
class="m-iframe"
id="iframes"
id="iframe"
width="100%"
height="100%"
style=""
frameborder="0"
scrolling="yes"
></iframe>
/>
</template>
<keep-alive v-else>
<keep-alive v-show="!tabIsIframe($router.currentRoute.meta.iframeURL)">
<router-view @changeCustomerName="changeCustomerName" />
</keep-alive>
</template>
@ -39,10 +38,12 @@ export default {
customerId: "",
};
},
watch: {
// "$router.currentRoute.name": function () {
// console.log($router.currentRoute);
// },
},
created() {
// this.$nextTick(() => {
// this.sendMessage()
// })
this.token = localStorage.getItem("token");
this.customerId = localStorage.getItem("customerId");
},
@ -118,18 +119,6 @@ export default {
);
this.$router.push({ name: "home" });
},
sendMessage() {
// const iframe = this.$refs.iframes.contentWindow
const iframe =
document.getElementsByClassName("iframes")[0].contentWindow;
console.log("iframe", iframe);
// iframe.postMessage({
// token: localStorage.getItem('token'),
// customerId: localStorage.getItem('customerId')
// }, '*')
iframe.postMessage({ name: "lalalal" }, "*");
},
},
};
</script>

Loading…
Cancel
Save