仪表盘
版本库
文件存储
活动
搜索
登录
client
/
fengdu-gases-web
丰都气体监测平台web
概况
操作记录
提交次数
目录
文档
分支
对比
blame
|
历史
|
原始文档
fix:shuju
web
6 天以前
c45cbdd1fb5e1c491a58f24be403b97999c1a9ec
[client/fengdu-gases-web.git]
/
src
/
utils
/
rem.js
1
2
3
4
5
6
7
8
function resize () {
const baseFontSize = 16
const windowWidth = document.documentElement.clientWidth;
const newVal = Math.round((windowWidth / 1920) * baseFontSize)
document.documentElement.style.fontSize = `${newVal}px`;
}
resize()
window.addEventListener('resize', resize);