iframe父子组件通信笔记
1.父组件传参:
var myFrame = document.getElementById("m-iframe-content");
myFrame.contentWindow.postMessage( tabName,"http://localhost:8084/");
2.子组件接收参数:
window.addEventListener('message', function(data){ console.log(data)});
原创
2021-06-01 18:11:31 ·
144 阅读 ·
0 评论