Vue uses lib flexible and postcss pxtorem (PX to REM) for adaptation

Time:2022-5-11

1. Development environment Vue
2. Computer system windows10 Professional Edition
3. In the process of development, we need to adapt. Let me share the methods below, hoping to be helpful to you.
4. Without much nonsense, operate directly:

//Install lib flexible
npm install lib-flexible --save-dev

5. Modify the Lib flexible configuration
Vue uses lib flexible and postcss pxtorem (PX to REM) for adaptation

//File on node_ modules>lib-flexible>flexible

5-1. In Mian Introducing lib flexible into TS

//Import lib flexible
import "lib-flexible";

6. Install postcss pxtorem (PX to REM)

npm install postcss-pxtorem -D

6-1. Create a new under the root directory postcssrc. JS (same level as package)

module.exports = {
  "plugins": {
    "autoprefixer": {},
    'postcss-pxtorem': {
      Rootvalue: 19.2, // 75 indicates 750 design draft, 37.5 indicates 375 design draft
      propList: ['*']
    }
  }
}

6-2. You may encounter the following errors
Vue uses lib flexible and postcss pxtorem (PX to REM) for adaptation
6-3. Analyze the reason
Vue uses lib flexible and postcss pxtorem (PX to REM) for adaptation

//The maximum version is 6. The version of 8 cannot be found

6-4. The solution is as follows:

npm install [email protected] -D

7. The sharing of this issue ends here. I hope it will help you. Let’s work together to reach the peak.

Recommended Today

Load Tomcat into IIS full introduction

Source: provided by netizens. If you have copyright problems, please contact us < br > < br > Tomcat IISHowto: load Tomcat into IIS full introduction < br > 1. My installation environment is W2k (Japanese version), iis5 < br > Tomcat3.1 download address < br > http://jakarta.apache.org/builds/tomcat/release/v3.1/bin/ <BR><BR>isapi_ redirect. DLL download address < br […]