当前位置: 首页>编程语言>正文

vue-cli中rem的使用

rem自适应布局插件配置

vue-cli插件配置

插件:lib-flexible

下载:npm install lib-flexible --save

在main.js中引入并全局注册

vue-cli中rem的使用,第1张

image.png

importflexiblefrom'lib-flexible'Vue.use(flexible)

vscode插件配置

下载插件:px to rem

vue-cli中rem的使用,第2张

image.png

根据文档进行配置

vscode:文件→首选项→设置在用户设置中进行设置

vue-cli中rem的使用,第3张

image.png

文档

vue-cli中rem的使用,第4张

image.png

px to rem,rem to px快捷键换算

选中需要换算的值:Alt+z

链接:https://www.jianshu.com/p/870f97bbc46d


https://www.xamrdz.com/lan/5a41848948.html

相关文章: