由于使用lib-flexible与postcss-px2rem来适配移动端,使px转rem方便开发,发现不适配ipad,为解决这个问题,找到了一个方法
https://www.jianshu.com/p/7aa4250c9293
由于这是vue-cli3的方法,vue-cli2中我配置的没效果,于是又想其他办法,最后搞定
npm install amfe-flexible -S
npm install postcss-px2rem -D
在main.js中引入amfe-flexible
import 'amfe-flexible'
找到.postcssrc.js文件
module.exports = {
"plugins": {
"postcss-import": {},
"postcss-url": {},
"autoprefixer": {},
"postcss-px2rem": {
"remUnit": 37.5
}
}
}
这样就可以以设计稿为375px,愉快的开发了