#=============================更新 2020-07-27 start==================
监听页面大小变化,可以在main.js文件中使用window.addEventListener方法进行监听处理。
例如:监听页面大小变化,进行字体处理
function onResize() {
let htmlBaseFontSize = 50;
let designBodyWidth = 375;
const url = window.location.href
// loginWeb和locStatusScreenWeb页面是在web端打开,因为不需要按比例放大页面
if(url.indexOf("locStatusScreenWeb") !== -1 || url.indexOf("loginWeb") !== -1){
htmlBaseFontSize = 50;
designBodyWidth = 1920;
}
let bodyWidth = document.body.getBoundingClientRect().width;
let resultFontSize = bodyWidth / designBodyWidth * htmlBase