cnpm i lib-flexible -S
cnpm i postcss-pxtorem -D
import 'lib-flexible'
"postcss": {
"plugins": {
"autoprefixer": {},
"postcss-pxtorem": {
"rootValue": 192,
"propList": [
"*"
]
}
}
},
function refreshRem(){
var width = docEl.getBoundingClientRect().width;
if (width / dpr > 540) {
width = width * dpr;
}
var rem = width / 10;
docEl.style.fontSize = rem + 'px';
flexible.rem = win.rem = rem;
}
cnpm run serve
转载请注明原文地址:https://ipadbbs.8miu.com/read-28609.html