解決vue使用vant輪播組件swipe + flex時文字抖動問題
原抖動效果

改后效果

解決方法
在外層容器的css里加上:transform: translateZ(0);
部分頁面代碼
<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>進(jìn)行中</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代碼
.d-meet-top {
display: flex;
justify-content: space-between;
transform: translateZ(0); // 《== 關(guān)鍵
}
.d-meet-top div {
display: flex;
align-items: center;
}
ps:下面看下vue-輪播圖導(dǎo)致下方文字抖動問題
在使用vantui的swipe組件時遇到下方文字抖動的問題
解決方案:在樣式里加入 transform: translateZ(0)
<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>
/deep/ .van-swipe {
text-align: center;
background-color: white;
transform: translateZ(0);
}
到此這篇關(guān)于解決vue使用vant輪播組件swipe + flex時文字抖動問題的文章就介紹到這了,更多相關(guān)vue使用vant輪播組件文字抖動內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
Vue 中獲取當(dāng)前時間并實時刷新的實現(xiàn)代碼
這篇文章主要介紹了Vue 中獲取當(dāng)前時間并實時刷新,本文通過實例代碼給大家介紹的非常詳細(xì),對大家的學(xué)習(xí)或工作具有一定的參考借鑒價值,需要的朋友可以參考下2020-05-05
vue數(shù)字金額動態(tài)變化功能實現(xiàn)方法詳解
這篇文章主要介紹了vue實現(xiàn)數(shù)字金額動態(tài)變化效果,數(shù)字動態(tài)變化是我們在前端開發(fā)中經(jīng)常需要做的效果,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧2022-09-09
VUE項目實現(xiàn)全屏顯示功能之screenfull用法
這篇文章主要介紹了VUE項目實現(xiàn)全屏顯示功能之screenfull用法,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教2024-01-01
vue3中template使用ref無需.value原因解析
vue3的template中使用ref變量無需使用.value,還可以在事件處理器中進(jìn)行賦值操作時,無需使用.value就可以直接修改ref變量的值,這篇文章主要介紹了原來vue3中template使用ref無需.value是因為這個,需要的朋友可以參考下2024-06-06
iview實現(xiàn)select tree樹形下拉框的示例代碼
這篇文章主要介紹了iview實現(xiàn)select tree樹形下拉框的示例代碼,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2018-12-12

