1.禁止缩放网页
项目目录下的index.html文件
Vue 移动端一般用到的配置

添加meta属性:user-scalable=no

width // 设置 viewport 的宽度,正整数/字符串 device-width
height // 设置 viewport 的高度,正整数/字符串 device-height
initial-scale // 设置设备宽度与 viewport大小之间的缩放比例,0.0-10.0之间的正数
maximum-scale // 设置最大缩放系数,0.0-10.0之间的正数
minimum-scale // 设置最小缩放系数,0.0-10.0之间的正数
user-scalable // 如果设置为 no 用户将不能缩放网页,默认为 yes,yes / no
2.main.js引用全局样式style.css
import ‘./assets/style.css’

style.css样式设置

chtml {
overflow-x: auto;
overflow-y: scroll;
}

body,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
fieldset,
input,
p,
blockquote,
th,
td {
font-weight: 400;
margin: 0;
padding: 0;
}

h1,
h2,
h3,
h4,
h4,
h5 {
margin: 0;
padding: 0;
}

body {
background-color: #f2f2f2;
color: #666666;
font-family: Helvetica, Arial, sans-serif;
font-size: 12px;
text-align: left;
}

select {
font-size: 12px;
}

table {
border-collapse: collapse;
}

fieldset,
img {
border: 0 none;
}

fieldset {
margin: 0;
padding: 0;
}

fieldset p {
margin: 0;
padding: 0 0 0 8px;
}

legend {
display: none;
}

address,
caption,
em,
strong,
th,
i {
font-style: normal;
font-weight: 400;
}

table caption {
margin-left: -1px;
}

hr {
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #E4E4E4;
border-width: 1px 0;
clear: both;
height: 2px;
margin: 5px 0;
overflow: hidden;
}

ol,
ul {
list-style-image: none;
list-style-position: outside;
list-style-type: none;
}

caption,
th {
text-align: left;
}

q:before,
q:after,
blockquote:before,
blockquote:after {
content: “”;
}

3.App.vue设置相关比例系数 rem转换

Vue 移动端一般用到的配置

分类:

技术点:

相关文章: