1.安装

npm install postcss-px2rem -S

2.webpack.base.conf.js配置

    remUnit: 100意思为1rem=100px

plugins:[
  new webpack.LoaderOptionsPlugin({
    vue: {
      postcss: [require('postcss-px2rem')({'remUnit': 100,'baseDpr':2})]
    },
  })
]

 

Logo

前往低代码交流专区

更多推荐