1. Install postcs-pxtorem NPM install postcs-pxtorem -d

{" name ":" the business - the manage - vue ", "version" : "0.0.0", "scripts" : {" dev ":" vite ", "build" : "Vite build"}, "dependencies" : {" @ vitejs/plugin - vue ":" ^ 1.2.5 ", "axios" : "^ 0.21.1", "element - plus" : "^ 1.0.2 - beta. 55", "qs" : "^ 6.10.1", "vue" : "^ 3.0.4", "vue - the router" : "^ 4.0.10", "vuex" : "^ 4.0.2"}, "devDependencies" : {" @ vue/compiler - SFC ":" ^ 3.0.4 ", "postcss - pxtorem" : "^ 6.0.0", "sass" : "^ 1.35.2", "vite" : "^ 1.0.0 - rc. 13," "vite - plugin - style - import" : "^" 1.0.1}}

2. New postcss. Config. Js

module.exports = {
  "plugins": {
    "postcss-pxtorem": {
      rootValue: 192,
      propList: ['*'],
      selectorBlackList: [
        'ant'
      ]
    }
  }
}