该安装的安装
1.import ‘lib-flexible/flexible’
2.build/untils:
const px2remLoader = {
loader: 'px2rem-loader',
options:{
remUnit: 144 // 设计图宽度/10
}
}
3.node包里找到flexible.js
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;
}