仪表盘
版本库
文件存储
活动
搜索
登录
client
/
nanjing-station-web
南京尼康地铁前端项目
概况
操作记录
提交次数
目录
文档
分支
对比
blame
|
历史
|
原始文档
fix:修改判断条件
web
2 天以前
2c1dadab445eadb661c08738fc471789d4a4d2af
[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`;
}
window.addEventListener('resize', resize);