1;vue vscode snippets 插件
1;vue vscode snippets 插件
1、rem(font size of the root element)是相对长度单位。相对于根元素(html元素)font-size计算值的倍数。1rem = html的font-size
2、设置html的fontSize:
iphone的width=320px,html默认的fontSize = 16px = 1rem, 即1rem = 屏幕width/20
// 得到手机屏幕的宽度
let htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
// 页面很大的时候,固定htmlWidth大小为750,解决页面字体过大的问题
if( htmlWidth > 750 ){ htmlWidth = 750 };
// 得到html的Dom元素
let htmlDom = document.getElementsByTagName('html')[0];
// 设置根元素字体大小
htmlDom.style.fontSize= htmlWidth/20 + 'px';
schema 用来定义模版
model:具备操作能力的集合
filter=》 |