大屏优化
This commit is contained in:
parent
793fc447bf
commit
fc799303ca
@ -2,7 +2,7 @@
|
|||||||
//获取布局视口宽度,因为开启了理想视口,布局视口=设备横向独立像素值
|
//获取布局视口宽度,因为开启了理想视口,布局视口=设备横向独立像素值
|
||||||
const dpWidth = document.documentElement.clientWidth
|
const dpWidth = document.documentElement.clientWidth
|
||||||
//计算根字体大小
|
//计算根字体大小
|
||||||
const rootFonstSize = (dpWidth * 100)/1960
|
const rootFonstSize = (dpWidth * 100)/1920
|
||||||
//设置根字体大小
|
//设置根字体大小
|
||||||
document.documentElement.style.fontSize = rootFonstSize + 'px'
|
document.documentElement.style.fontSize = rootFonstSize + 'px'
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user