解決vue使用vant輪播組件swipe + flex時(shí)文字抖動(dòng)問題
原抖動(dòng)效果
改后效果
解決方法
在外層容器的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;">參會(huì)人</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)致下方文字抖動(dòng)問題
在使用vantui的swipe組件時(shí)遇到下方文字抖動(dòng)的問題
解決方案:在樣式里加入 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時(shí)文字抖動(dòng)問題的文章就介紹到這了,更多相關(guān)vue使用vant輪播組件文字抖動(dòng)內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
VUE3基礎(chǔ)學(xué)習(xí)之click事件詳解
由于vue是一個(gè)雙向數(shù)據(jù)綁定的框架,它的點(diǎn)擊事件與以前常用的還是有很大的差別的,下面這篇文章主要給大家介紹了關(guān)于VUE3基礎(chǔ)學(xué)習(xí)之click事件的相關(guān)資料,需要的朋友可以參考下2022-01-01vue3使用自定義指令實(shí)現(xiàn)el dialog拖拽功能示例詳解
這篇文章主要為大家介紹了vue3使用自定義指令實(shí)現(xiàn)el dialog拖拽功能示例詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進(jìn)步,早日升職加薪2022-09-09Vue快速實(shí)現(xiàn)通用表單驗(yàn)證功能
這篇文章主要介紹了Vue快速實(shí)現(xiàn)通用表單驗(yàn)證功能,本文通過一個(gè)小例子給大家介紹的非常詳細(xì),具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2019-12-12vue.js實(shí)例對(duì)象+組件樹的詳細(xì)介紹
這篇文章主要介紹了vue.js實(shí)例對(duì)象+組件樹的相關(guān)資料,需要的朋友可以參考下2017-10-10Vue.js中使用components組件的實(shí)例講解
這篇文章主要介紹了Vue.js中使用components組件的實(shí)例講解,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2023-07-07Vue組件數(shù)據(jù)傳遞與props校驗(yàn)方式
這篇文章主要介紹了Vue組件數(shù)據(jù)傳遞與props校驗(yàn)方式,具有很好的參考價(jià)值,希望對(duì)大家有所幫助,如有錯(cuò)誤或未考慮完全的地方,望不吝賜教2024-08-08