|
1 | 1 | <template> |
2 | 2 | <view :class="`wd-swiper ${customClass}`" :style="customStyle"> |
3 | | - <swiper |
4 | | - :adjust-height="adjustHeight" |
5 | | - :adjust-vertical-height="adjustVerticalHeight" |
6 | | - class="wd-swiper__track" |
7 | | - :autoplay="autoplay && !videoPlaying" |
8 | | - :current="navCurrent" |
9 | | - :interval="interval" |
10 | | - :duration="duration" |
11 | | - :circular="loop" |
12 | | - :vertical="direction == 'vertical'" |
13 | | - :easing-function="easingFunction" |
14 | | - :previous-margin="addUnit(previousMargin)" |
15 | | - :next-margin="addUnit(nextMargin)" |
16 | | - :snap-to-edge="snapToEdge" |
17 | | - :display-multiple-items="displayMultipleItems" |
18 | | - :style="{ height: addUnit(height) }" |
19 | | - @change="handleChange" |
20 | | - @animationfinish="handleAnimationfinish" |
21 | | - > |
22 | | - <swiper-item v-for="(item, index) in list" :key="index" class="wd-swiper__item"> |
23 | | - <video |
24 | | - v-if="isVideo(item)" |
25 | | - :id="`video-${index}-${uid}`" |
26 | | - :style="{ height: addUnit(height) }" |
27 | | - :src="isObj(item) ? item[valueKey] : item" |
28 | | - :poster="isObj(item) ? item.poster : ''" |
29 | | - :class="`wd-swiper__video ${customItemClass} ${getCustomItemClass(currentValue, index, list)}`" |
30 | | - @play="handleVideoPaly" |
31 | | - @pause="handleVideoPause" |
32 | | - :enable-progress-gesture="false" |
33 | | - :loop="videoLoop" |
34 | | - :muted="muted" |
35 | | - :autoplay="autoplayVideo" |
36 | | - objectFit="cover" |
37 | | - @click="handleClick(index, item)" |
38 | | - /> |
39 | | - <image |
40 | | - v-else |
41 | | - :src="isObj(item) ? item[valueKey] : item" |
42 | | - :class="`wd-swiper__image ${customImageClass} ${customItemClass} ${getCustomItemClass(currentValue, index, list)}`" |
43 | | - :style="{ height: addUnit(height) }" |
44 | | - :mode="imageMode" |
45 | | - @click="handleClick(index, item)" |
46 | | - /> |
| 3 | + <!-- #ifdef MP-WEIXIN --> |
| 4 | + <scroll-view scroll-x scroll-y style="width: 100%; height: 100%"> |
| 5 | + <!-- #endif --> |
| 6 | + <swiper |
| 7 | + :adjust-height="adjustHeight" |
| 8 | + :adjust-vertical-height="adjustVerticalHeight" |
| 9 | + class="wd-swiper__track" |
| 10 | + :autoplay="autoplay && !videoPlaying" |
| 11 | + :current="navCurrent" |
| 12 | + :interval="interval" |
| 13 | + :duration="duration" |
| 14 | + :circular="loop" |
| 15 | + :vertical="direction == 'vertical'" |
| 16 | + :easing-function="easingFunction" |
| 17 | + :previous-margin="addUnit(previousMargin)" |
| 18 | + :next-margin="addUnit(nextMargin)" |
| 19 | + :snap-to-edge="snapToEdge" |
| 20 | + :display-multiple-items="displayMultipleItems" |
| 21 | + :style="{ height: addUnit(height) }" |
| 22 | + @change="handleChange" |
| 23 | + @animationfinish="handleAnimationfinish" |
| 24 | + > |
| 25 | + <swiper-item v-for="(item, index) in list" :key="index" class="wd-swiper__item"> |
| 26 | + <video |
| 27 | + v-if="isVideo(item)" |
| 28 | + :id="`video-${index}-${uid}`" |
| 29 | + :style="{ height: addUnit(height) }" |
| 30 | + :src="isObj(item) ? item[valueKey] : item" |
| 31 | + :poster="isObj(item) ? item.poster : ''" |
| 32 | + :class="`wd-swiper__video ${customItemClass} ${getCustomItemClass(currentValue, index, list)}`" |
| 33 | + @play="handleVideoPaly" |
| 34 | + @pause="handleVideoPause" |
| 35 | + :enable-progress-gesture="false" |
| 36 | + :loop="videoLoop" |
| 37 | + :muted="muted" |
| 38 | + :autoplay="autoplayVideo" |
| 39 | + objectFit="cover" |
| 40 | + @click="handleClick(index, item)" |
| 41 | + /> |
| 42 | + <image |
| 43 | + v-else |
| 44 | + :src="isObj(item) ? item[valueKey] : item" |
| 45 | + :class="`wd-swiper__image ${customImageClass} ${customItemClass} ${getCustomItemClass(currentValue, index, list)}`" |
| 46 | + :style="{ height: addUnit(height) }" |
| 47 | + :mode="imageMode" |
| 48 | + @click="handleClick(index, item)" |
| 49 | + /> |
47 | 50 |
|
48 | | - <text v-if="isObj(item) && item[textKey]" :class="`wd-swiper__text ${customTextClass}`" :style="customTextStyle">{{ item[textKey] }}</text> |
49 | | - </swiper-item> |
50 | | - </swiper> |
| 51 | + <text v-if="isObj(item) && item[textKey]" :class="`wd-swiper__text ${customTextClass}`" :style="customTextStyle">{{ item[textKey] }}</text> |
| 52 | + </swiper-item> |
| 53 | + </swiper> |
| 54 | + <!-- #ifdef MP-WEIXIN --> |
| 55 | + </scroll-view> |
| 56 | + <!-- #endif --> |
51 | 57 |
|
52 | 58 | <template v-if="indicator"> |
53 | 59 | <slot name="indicator" :current="currentValue" :total="list.length"></slot> |
|
0 commit comments