| | |
| | | class="u-swiper__loading" |
| | | v-if="loading" |
| | | > |
| | | <u-loading-icon mode="circle"></u-loading-icon> |
| | | <up-loading-icon mode="circle"></up-loading-icon> |
| | | </view> |
| | | <swiper |
| | | v-else |
| | |
| | | v-for="(item, index) in list" |
| | | :key="index" |
| | | > |
| | | <slot :item="item" :index="index"> |
| | | <view |
| | | class="u-swiper__wrapper__item__wrapper" |
| | | :style="[itemStyle(index)]" |
| | |
| | | controls |
| | | @tap="clickHandler(index)" |
| | | ></video> |
| | | <text |
| | | v-if="showTitle && testObject(item) && item.title && testImage(getSource(item))" |
| | | class="u-swiper__wrapper__item__wrapper__title u-line-1" |
| | | >{{ item.title }}</text> |
| | | <view v-if="showTitle && testObject(item) && item.title && testImage(getSource(item))" |
| | | class="u-swiper__wrapper__item__wrapper__title"> |
| | | <text class="u-line-1">{{ item.title }}</text> |
| | | </view> |
| | | </view> |
| | | </slot> |
| | | </swiper-item> |
| | | </swiper> |
| | | <view class="u-swiper__indicator" :style="[addStyle(indicatorStyle)]"> |
| | | <slot name="indicator"> |
| | | <u-swiper-indicator |
| | | <up-swiper-indicator |
| | | v-if="!loading && indicator && !showTitle" |
| | | :indicatorActiveColor="indicatorActiveColor" |
| | | :indicatorInactiveColor="indicatorInactiveColor" |
| | | :length="list.length" |
| | | :current="currentIndex" |
| | | :indicatorMode="indicatorMode" |
| | | ></u-swiper-indicator> |
| | | ></up-swiper-indicator> |
| | | </slot> |
| | | </view> |
| | | </view> |
| | |
| | | this.currentIndex = val; // 和上游数据关联上 |
| | | } |
| | | }, |
| | | emits: ["click", "change"], |
| | | emits: ["click", "change", "update:current"], |
| | | computed: { |
| | | itemStyle() { |
| | | return index => { |
| | |
| | | } = e.detail |
| | | this.pauseVideo(this.currentIndex) |
| | | this.currentIndex = current |
| | | this.$emit('update:current', this.currentIndex) |
| | | this.$emit('change', e.detail) |
| | | }, |
| | | // 切换轮播时,暂停视频播放 |