prod
校文 3 years ago
parent 9b04f49fdc
commit 7ac480e529

@ -1,3 +1,11 @@
/*
* @Author: your name
* @Date: 2021-10-26 11:23:45
* @LastEditTime: 2021-12-02 17:16:22
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: /data-show/src/utils/rem/index.js
*/
// rem等比适配配置文件
// 基准大小
const baseSize = 16
@ -8,10 +16,10 @@ function setRem() {
const scale = w / 1920
if (w >= 1920) {
document.documentElement.style.fontSize = baseSize + 'px';
} else if (1500 < w && w < 1920) {
} else if (1440 < w && w < 1920) {
document.documentElement.style.fontSize = baseSize * Math.min(scale, 2) + 'px'
} else {
document.documentElement.style.fontSize = baseSize * 1500 / 1920 + 'px';
document.documentElement.style.fontSize = baseSize * 1440 / 1920 + 'px';
}
}
// 初始化

Loading…
Cancel
Save