let timer = null
//自适应
function adaptive() {
clearTimeout(timer)//写个防抖减少不必要触发
timer = setTimeout(() => {
var curWidth = document.documentElement.clientWidth
var rem = curWidth * 45 / 1920
document.documentElement.style.fontSize = rem + "px"
}, 300)
}
window.onpageshow = adaptive
window.onresize = adaptive