1.amfe-flexible

  • Automatically changes the HTML font size based on the page width
  • yarn add amfe-flexible -S
  • npm i amfe-flexible -S
  • Introduced in the main. Jsimport "amfe-flexible"

2.postcss

  • downloadYarn add postcss [email protected] -d
  • Automatically convert PX to REM
  • Create a postcss.config.js file in the root directory and write it as follows:
module.exports = {
  plugins: {
    'postcss-pxtorem': {
      rootValue: 37.5.propList: [The '*']}}}Copy the code