<div style="margin-left: 10px; margin-right: 10px" id="app" v-cloak>
<iframe id="mainiframe" src="http://www.baidu.com" width="100%" scrolling="auto" onload="changeFrameHeight()" allowtransparency="true" style="background-color:transparent" frameborder="0">
您的浏览器不支持嵌入式框架,或者当前配置为不显示嵌入式框架。
</iframe>
</div>
<script type="text/javascript">
function changeFrameHeight(){
var ifm= document.getElementById("mainiframe");
ifm.height=document.documentElement.clientHeight;
}
window.onresize=function(){
changeFrameHeight();
}
</script>
设置高度自适应:onload="changeFrameHeight()"
设置背景色透明:allowtransparency="true" style="background-color:transparent"
设置无边框:frameborder="0"
参考博文:https://blog.csdn.net/qq_26440803/article/details/80508015