这是正常情况下没有问题
这是部分全屏缩放就失效了,搞不懂什么原因
1.可以使用大屏框架
http://datav.jiaminghi.com/guide/fullScreenContainer.html
<dv-full-screen-container>content</dv-full-screen-container>
2.
export function refreshScale(){
let baseWidth = document.documentElement.clientWidth;
let baseHeight = document.documentElement.clientHeight;
let appStyle = document.getElementById('app').style;
let realRatio = baseWidth/baseHeight
let designRatio = 16/9
let scaleRate = baseWidth/1920
if(realRatio>designRatio){
scaleRate = baseHeight/1080
}
appStyle.transformOrigin = 'left top';
appStyle.transform=`scale(${scaleRate}) translateX(-50%)`;
appStyle.width = `${baseWidth/scaleRate}px`
}
mounted(){
refreshScale();
window.onresize=function(){
refreshScale()
}
}
这是屏幕缩放问题造成的,可能是你的 meta标签设置了固定宽度造成的,可参考如下链接解决试试https://zhidao.baidu.com/question/2011533894395118028.html