移动端适配只要在html上加个
<meta name="viewport" content="width=750,user-scalable=no">
这个750是指屏幕宽度,这个值改成UI设计稿上的宽度,然后下面所有的尺寸都按照设计稿的来就行了,他会自动缩放的。
但是ant design mobile 没有跟上这个viewport,就是我们自己用viewport适配的很好,但是他这个组件却没有适配,所以得适配
![](https://img.haomeiwen.com/i7852092/2c4d39b774a34a84.png)
![](https://img.haomeiwen.com/i7852092/d5a6a8a31e8a5273.png)
在这个全局的less里面直接这样加上,就ok了
移动端适配只要在html上加个
<meta name="viewport" content="width=750,user-scalable=no">
这个750是指屏幕宽度,这个值改成UI设计稿上的宽度,然后下面所有的尺寸都按照设计稿的来就行了,他会自动缩放的。
但是ant design mobile 没有跟上这个viewport,就是我们自己用viewport适配的很好,但是他这个组件却没有适配,所以得适配
在这个全局的less里面直接这样加上,就ok了
本文标题:关于移动端适配
本文链接:https://www.haomeiwen.com/subject/thpnphtx.html
网友评论