From 3b3bc96ec57a7cb1708a8c4bb4aaa59ea0f7568e Mon Sep 17 00:00:00 2001 From: dai <851733175@qq.com> Date: Fri, 18 Mar 2022 14:12:41 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B5=8C=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/main-shuju/main-content.vue | 29 +++++++++------------------ 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/views/main-shuju/main-content.vue b/src/views/main-shuju/main-content.vue index 33bc09e8..a67827be 100644 --- a/src/views/main-shuju/main-content.vue +++ b/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" - > + /> - + @@ -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" }, "*"); - }, }, };