Commit 90bc57a6 authored by zxw's avatar zxw

适配修改

parent c41d145c
......@@ -3,14 +3,10 @@
const baseSize = 16
// 设置 rem 函数
function setRem() {
// 当前页面屏幕分辨率相对于 的缩1920宽放比例,可根据自己需要修改
// 当前页面屏幕分辨率相对于 1920宽的缩放比例,可根据自己需要修改
const scale = document.documentElement.clientWidth / 1920
// 设置页面根节点字体大小(“Math.min(scale, 2)” 指最高放大比例为2,可根据实际业务需求调整)
// document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
// 设置页面根节点字体大小, 字体大小最小为12
const fontSize = (baseSize * Math.min(scale, 2)) > 16 ? (baseSize * Math.min(scale, 2)) : 16
document.documentElement.style.fontSize = fontSize + 'px'
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
}
// 初始化
setRem()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment