| | |
| | | data: Object, |
| | | }, |
| | | created() { |
| | | window.addEventListener("message", (e) => { |
| | | if (e.data.msg === "showBack") { |
| | | this.isShowBack = true; |
| | | } |
| | | }); |
| | | this.addBackListener(); |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | //return false; |
| | | }, |
| | | |
| | | // 菜单栏返回 |
| | | back() { |
| | | let active = this.$store.state.desktop.minDocks; |
| | | active = active.filter((item) => item.highlight); |
| | | console.log(`返回${active.alt}`); |
| | | console.log(active); |
| | | const iframeArr = document.querySelectorAll("iframe"); |
| | | iframeArr.forEach((item) => { |
| | | item.contentWindow.postMessage({ msg: `返回${active[0].alt}` }, "*"); |
| | | }); |
| | | }, |
| | | // 添加返回按钮相关监听 |
| | | addBackListener() { |
| | | //显示返回按钮 |
| | | window.addEventListener("message", (e) => { |
| | | if (e.data.msg === "showBack") { |
| | | this.isShowBack = true; |
| | | } |
| | | }); |
| | | //隐藏返回按钮 |
| | | window.addEventListener("message", (e) => { |
| | | if (e.data.msg === "hiddenBack") { |
| | | this.isShowBack = false; |
| | | } |
| | | }); |
| | | }, |
| | | }, |
| | | directives: { |
| | | drag(el, binding) { |