一、安裝插件
npm i postcss-pxtorem lib-flexible -D
二、postcss.config.js
module.exports = {
plugins: {
'autoprefixer': {
browsers: ['Android >= 4.0', 'iOS >= 8']
},
'postcss-pxtorem': {
rootValue: 37.5,
propList: ['*']
}
}
}
三、main.js
import "lib-flexible/flexible"