如果父页面与子页面的协议、端口号、域名一致,则可以通过获取元素的方式进行通信(详见:https://blog.csdn.net/hhf235678/article/details/103894827),但某一个不一致时,则需要通过window.postMessage()方式进行通信
父页面:
<div>
<iframe :src="xxx" id="parentPage"></iframe>
</div>
<script
如果父页面与子页面的协议、端口号、域名一致,则可以通过获取元素的方式进行通信(详见:https://blog.csdn.net/hhf235678/article/details/103894827),但某一个不一致时,则需要通过window.postMessage()方式进行通信
父页面:
<div>
<iframe :src="xxx" id="parentPage"></iframe>
</div>
<script