跑一个h5,pc端vue项目,pc端编辑后,样式,字体有变小问题
import "lib-flexible/flexible.js";
原本个文件是用来适配移动端的,所以这里需要修改一下源码
function refreshRem() {
var width = docEl.getBoundingClientRect().width;
// if (width / dpr > 540) {
// width = 1920 * dpr;
// }
var rem = width / 24;
docEl.style.fontSize = rem + 'px';
flexible.rem = win.rem = rem;
}
把540限制关掉,直接让他适配pc