<iframe style="position: fixed; top: 0px; left: 0px; width: 100%; height: 100%; border: none; z-index: 2147483647;"></iframe>
解决方法:通过css使iframe不再阻止点击,或者让iframe不再显示
在自己项目的根目录css样式文件(全局样式文件)中,为iframe 添加pointer-events: none 属性
比如我根目录的文件是 index.scss, 就在文件中添加
iframe {
pointer-events: none;
}
若不想禁用页面中所有iframe
body > iframe {
pointer-events: none;
}
也可以
iframe {
display: none;
}
或者是因为使用旧版本react-scripts,升级至5也可以解决这个问题
npm install --save react-scripts@5