提交 9df7d42b 编写于 作者: H hdx

swiper-list: 新增 text 属性 space="nbsp",和 app 的默认效果保持一致

上级 11e083cb
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="swiper-list"> <view class="swiper-list">
<scroll-view ref="tabScroll" class="swiper-tabs" direction="horizontal" :show-scrollbar="false"> <scroll-view ref="tabScroll" class="swiper-tabs" direction="horizontal" :show-scrollbar="false">
<view class="flex-row"> <view class="flex-row">
<text ref="swipertab" class="swiper-tabs-item" :class="swiperIndex==index ? 'swiper-tabs-item-active' : ''" <text ref="swipertab" space="nbsp" class="swiper-tabs-item" :class="swiperIndex==index ? 'swiper-tabs-item-active' : ''"
v-for="(item, index) in swiperList" :key="index" @click="onTabClick(index)"> v-for="(item, index) in swiperList" :key="index" @click="onTabClick(index)">
{{item.title}} {{item.title}}
</text> </text>
...@@ -103,7 +103,9 @@ ...@@ -103,7 +103,9 @@
const percentage = Math.abs(current_offset_x) / this.swiperWidth const percentage = Math.abs(current_offset_x) / this.swiperWidth
// 通知更新指示线 // 通知更新指示线
if (current_index != move_to_index) {
this.updateTabIndicator(current_index, move_to_index, percentage) this.updateTabIndicator(current_index, move_to_index, percentage)
}
}, },
/** /**
* Swiper滑动动画结束事件. * Swiper滑动动画结束事件.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册