html中调用vue中的方法
1.vue中定义addEventListenerswitchLayer() {window.addEventListener("message",function(e){debugger;console.log(e.data);});}2.js中定义postMessagevar myIframe = document.getElem...
·
1.vue中定义addEventListener
switchLayer() {
window.addEventListener("message",function(e){
debugger;
console.log(e.data);
});
}
2.js中定义postMessage
var myIframe = document.getElementById('3diframe')
myIframe.contentWindow.postMessage({
data :"params"
},'http://127.0.0.1:8021');
更多推荐
已为社区贡献1条内容
所有评论(0)