Tag Archives: Vue mobile terminal adaptation

The problem of error in adaptation of Vue using vant mobile terminal rem

Using vant to adapt REM to
any gate vant

If necessary  rem   It is recommended to use the following two tools for adaptation

postcss-pxtorem   Is a post CSS plug-in, used to convert PX units into REM units lib flexible   Used to set the REM reference value

npm install postcss-pxtorem --save-dev
npm i -S amfe-flexible

  Create a new postcss. Config. JS
in the root directory  

module.exports = {
    plugins: {
      'autoprefixer': {
        browsers: ['Android >= 4.0', 'iOS >= 8']
      },
      'postcss-pxtorem': {
        rootValue: 37.5,
        propList: ['*']
      }
    }
  }

Introduce main.js again

import 'amfe-flexible'

NPM run serve startup found an error

  Check that the package.json version is too high
“postcss pxtorem”:  “^ 6.0.0”,

Degraded version

npm i [email protected]

e.g. run serve 21551; 36816;