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;
Read More:
- The Vue mobile terminal cannot use string.replaceall, and the error message is blank
- It is invalid to submit the content directly after pasting it on the mobile terminal of Vue HTML5 editor
- The uni app references the vant component and reports an error unclosed bracket when compiling
- Pcl1.9 + vs2017 + win10 installation instructions and MFC adaptation
- Error:PostCSS plugin postcss-pxtorem requires PostCSS 8
- Solutions to the problem that Ubuntu is stuck when copying large files and can’t mount mobile hard disk normally
- Uniapp Use vant Weapp icon Module Error [How to Fix]
- The problem of mobile hybrid development RN Android deployment appears Unsupported class file major version xx
- Solve the problem of “error empty block statement no empty” in the console (Vue project)
- Writing to settings when appium of Xiaomi mobile phone and oppo mobile phone starts requires:android.permission.WRITE_ SECURE_ SETTINGS
- Vue error: no postcss config found solution
- Quirky error 18: transfer closed with outstanding read data rem
- Threejs is used in Vue to introduce error reporting problem of orbitcontrols
- The problem that the El icons icon cannot be displayed in vue3 + element plus + vite
- How to solve the cross domain problem of Axios in Vue project
- Error: PostCSS plugin postcss-pxtorem requires PostCSS 8
- Vue3 uses element plus package to solve the problem of occasionally disordered code on the icon after it goes online
- Error in legal external terminal in ANSYS electronics desktop
- Vant weapp uses the dialog pop-up box to prompt for path error
- Restart and shutdown of Ubuntu system in the terminal