大屏优化

This commit is contained in:
hrx 2026-01-26 11:48:44 +08:00
parent 793fc447bf
commit fc799303ca

View File

@ -2,7 +2,7 @@
//获取布局视口宽度,因为开启了理想视口,布局视口=设备横向独立像素值
const dpWidth = document.documentElement.clientWidth
//计算根字体大小
const rootFonstSize = (dpWidth * 100)/1960
const rootFonstSize = (dpWidth * 100)/1920
//设置根字体大小
document.documentElement.style.fontSize = rootFonstSize + 'px'
}