iframe-宽高自适应显示
<iframe :src="URL" id="mobsf" scrolling="no" frameborder="0"></iframe>
加载完成后自适应
*/
mounted() {
function changeMobsfIframe() {
const mobsf = document.getElementById('mobsf');
const deviceWidth = document.body.clientWidth;
const deviceHeight = document.body.clientHeight;
mobsf.style.width = (Number(deviceWidth) - 250) + 'px'; //数字是页面布局宽度差值
mobsf.style.height = (Number(deviceHeight)) + 'px';
}
}
css对齐原来的页面
iframe{
width: calc(100% - 250px);
height: 100%;
position:absolute;
top:0px;
left: 250px;
right:0px;
bottom:100px;
}