仪表盘
版本库
文件存储
活动
搜索
登录
client
/
nanjing-station-web
南京尼康地铁前端项目
概况
操作记录
提交次数
目录
文档
分支
对比
blame
|
历史
|
原始文档
fix:修改运行时间判断方式
web
2025-04-23
c9e42b64faf5cf702c2f887071193c10d8b8c842
[client/nanjing-station-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);