- 下载插件
npm install lib-flexible postcss-pxtorem@5.1.1 --save -dev
- 在main.js文件中引入
//引入适配包
import 'lib-flexible/flexible'
- 在项目目录下新建 .postcssrc.js 代码块:
module.exports = {
plugins: {
autoprefixer: {
overrideBrowserslist: ['Android 4.1', 'iOS 7.1', 'Chrome > 31', 'ff > 31', 'ie >= 8']
},
'postcss-pxtorem': {
rootValue: 75,
propList: ['*']
}
}
}
注意:
下载插件是尽量不要下载
cnpm install lib-flexible postcss-pxtorem --save-dev
--容易导