vue中使用rem布局

1、npm i amfe-flexible

2、import 'amfe-flexible' 

然后再,安装postcss-px2rem插件

npm i postcss-px2rem

在package.json中配置

"postcss": {
    "plugins": {
      "autoprefixer": {},
      "postcss-px2rem": {
        "remUnit": 26.7 } } }

猜你喜欢

转载自www.cnblogs.com/woaiqianduan/p/11762246.html