预览会触发多次事件的代码:
window.addEventListener("message", function(event) {
console.log('event === ', event);
});
修改后的有效代码:
window.onmessage = function(event){
console.log('event === ', event);
};
预览会触发多次事件的代码:
window.addEventListener("message", function(event) {
console.log('event === ', event);
});
修改后的有效代码:
window.onmessage = function(event){
console.log('event === ', event);
};