前端在js中获取1rem的值

681 阅读1分钟
/*获取rem单位*/
const rem = parseInt(getComputedStyle(document.documentElement).fontSize)