原抖动效果
改后效果
解决方法
在外层容器的css里加上:transform: translateZ(0);
部分页面代码
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
<van-swipe-item v- for = "(item,index) in meetingList" :key= "index" >
<div class= "d-meet-top" >
<div>
<van-icon name= "clock" class= "v-icon" color= "#AEAEB0" />
<span class= "gray s-text" >今天</span>
<span class= "gray" style= "color:#111111;font-weight:bold;letter-spacing: -1px;" >
{{item.startTime}}
<span class= "gray" style= "margin:0 .5rem;" >—</span>
{{item.endTime}}
</span>
</div>
<div class= "d-status green" >
<span>进行中</span>
</div>
</div>
<div class= "d-meet-top" >
<div>
<van-icon name= "location" class= "v-icon" color= "#AEAEB0" />
<span class= "gray s-text" >{{item.location}}</span>
</div>
<div>
<span class= "gray s-text" style= "margin-left:0;" >参会人</span>
<span class= "s-name" v- for = "(data,index) in item.person" :key= "index" > {{data.substring(0,1)}}</span>
<van-icon v- if = "item.person.length>3 || true" name= "ellipsis" color= "#AEAEB0" />
</div>
</div>
</van-swipe-item>
|
部分css代码
1
2
3
4
5
6
7
8
9
10
|
.d-meet- top {
display : flex;
justify- content : space-between;
transform: translateZ( 0 ); // 《== 关键
}
.d-meet- top div {
display : flex;
align-items: center ;
}
|
ps:下面看下vue-轮播图导致下方文字抖动问题
在使用vantui的swipe组件时遇到下方文字抖动的问题
解决方案:在样式里加入 transform: translateZ(0)
1
2
3
4
5
6
7
8
9
|
<van-swipe :autoplay= "3000" >
<van-swipe-item v- for = "(swipeItem,index) of swipeList"
:key= "index"
@click= "bannerJump(swipeItem.imgUrl,swipeItem.bannerId)" >
<div class= "swipe-img-container" >
<img v-lazy= "swipeItem.img" class= "swipe-img" >
</div>
</van-swipe-item>
</van-swipe>
|
1
2
3
4
5
|
/deep/ .van-swipe {
text-align: center;
background-color: white;
transform: translateZ(0);
}
|
到此这篇关于解决vue使用vant轮播组件swipe + flex时文字抖动问题的文章就介绍到这了,更多相关vue使用vant轮播组件文字抖动内容请搜索服务器之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持服务器之家!
原文链接:https://www.cnblogs.com/linjiangxian/p/14245440.html