rem的值相当于根元素font-size值的倍数
1rem = 根元素font-size;
2rem = 根元素font-size * 2
dom加载完毕动态设置根元素font-size
html.style.fontSize = window.innerWidth/10 + 'px’
------------------------------------------------------------------
在app.vue设置rem
document.addEventListener('DOMContentLoaded', () => {
const html = document.querySelector('html')
let fontSize = window.innerWidth / 10
fontSize = fontSize > 50 ? 50 : fontSize
html.style.fontSize = fontSize + 'px'
})