转载
http://blog.sina.com.cn/s/blog_1583435db0102ybkx.html
(1)安装lib-flexible
npm install lib-flexible --save
(2) 在main.js中引入lib-flexible
import 'lib-flexible'
(3) 安装postcss-px2rem-exclude
npm install postcss-px2rem-exclude --save
(4) 在项目根目录中的package.json配置
"postcss": {
"plugins": {
"autoprefixer": {},
"postcss-px2rem-exclude":{
"remUnit": 75,
"exclude":"/node_modules|floder_name/i"
}
}
},
(5)完成。重启项目。