vue中px转rem插件
文章目录
1.amfe-flexible
- 根据网页宽度自动更改html字体大小
yarn add amfe-flexible -Snpm i amfe-flexible -S- main.js中引入
import "amfe-flexible"
2.postcss
- 下载
yarn add postcss postcss-pxtorem@5.1.1 -D - 自动将px转换为rem
- 根目录下创建postcss.config.js文件
module.exports = {
plugins: {
'postcss-pxtorem': {
rootValue: 37.5,
propList: ['*']
}
}
}
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论