vue-cli中rem的使用

rem自适应布局插件配置

vue-cli插件配置

插件:lib-flexible

  1. 下载:npm install lib-flexible --save
  2. main.js中引入并全局注册
vue-cli中rem的使用_第1张图片
image.png
import flexible from 'lib-flexible'
Vue.use(flexible)
vscode插件配置
  1. 下载插件: px to rem
vue-cli中rem的使用_第2张图片
image.png
  1. 根据文档进行配置
    vscode:文件首选项设置 在用户设置中进行设置
vue-cli中rem的使用_第3张图片
image.png

文档

vue-cli中rem的使用_第4张图片
image.png

  1. px to rem,rem to px快捷键换算
    选中需要换算的值:Alt+z

你可能感兴趣的:(vue-cli中rem的使用)