let count = 1080 module.exports = { "plugins": { "postcss-px-to-viewport": { viewportWidth: count, // 视窗的宽度,对应的是我们设计稿的宽度,一般是750 // viewportHeight: 100, // 视窗的高度,根据750设备的宽度来指定,一般指定1334,也可以不配置 unitPrecision: 3, // 指定`px`转换为视窗单位值的小数位数(很多时候无法整除) viewportUnit: 'vh', // 指定需要转换成的视窗单位,建议使用vw fontViewportUnit: 'vh', selectorBlackList: ['.ignore', '.hairlines'], // 指定不转换为视窗单位的类,可以自定义,可以无限添加,建议定义一至两个通用的类名 minPixelValue: 0.0001, // 小于或等于`1px`不转换为视窗单位,你也可以设置为你想要的值 mediaQuery: true, // 允许在媒体查询中转换`px` exclude: [/node_modules/,/src\/view\/other/,/src\/view\/login/,/src\/assets/,/src\/components/], //以Tabbar文件开头的不转化 // exclude: [/node_modules/,/src\/view\/other/,/src\/assets/,/src\/components/], //以Tabbar文件开头的不转化 // propList: ['*','!min-width','!min-height'] } } }