修改 .postcsssrc.js 中关于 postcss-px-to-viewport 的 selectorBlackList忽略转换的配置可解决问题, 配置如下
module.exports = {
"plugins":{
"postcss-import":{},
"postcss-url":{},
"postcss-aspect-ratio-mini":{},
"postcss-write-svg":{
utf8:false
},
"postcss-cssnext":{},
"postcss-px-to-viewport":{
viewportWidth:750,
viewportHeight:1334,
unitPrecision:3,
viewportUnit:'vw',
selectorBlackList:['.ignore','.hairlines','van'], // (Array) The selectors to ignore and leave as px.
minPixelValue:1, // (Number) Set the minimum pixel value to replace.
mediaQuery:false // (Boolean) Allow px to be converted in media queries.
},
"cssnano":{
preset:"advanced",
autoprefixer:false,
"postcss-zindex":false
}
}
}