|
@@ -20,6 +20,7 @@
|
|
|
<swiper-item class="fs-swiper-item-box" v-for="(item, index) in list" :key="index" @click="handleClick">
|
|
|
<view class="fs-swiper-item" :class="{'card-cur': index === curIndex}">
|
|
|
<fs-avatar shape="square" radius width="100%" height="100%" :src="item[keyMap.src]"></fs-avatar>
|
|
|
+ <view class="fs-swiper-item-text line1" v-if="showTitle">{{item[keyMap.title]}}</view>
|
|
|
</view>
|
|
|
</swiper-item>
|
|
|
</template>
|
|
@@ -27,6 +28,7 @@
|
|
|
<swiper-item class="fs-swiper-item-box" v-for="(item, index) in list" :key="index" @click="handleClick">
|
|
|
<view class="fs-swiper-item">
|
|
|
<fs-avatar shape="square" width="100%" height="100%" :src="item[keyMap.src]"></fs-avatar>
|
|
|
+ <view class="fs-swiper-item-text line1" v-if="showTitle">{{item[keyMap.title]}}</view>
|
|
|
</view>
|
|
|
</swiper-item>
|
|
|
</template>
|
|
@@ -95,14 +97,16 @@ const props = defineProps({
|
|
|
type: Object,
|
|
|
default() {
|
|
|
return {
|
|
|
- src: 'src'
|
|
|
+ src: 'src',
|
|
|
+ title: 'title'
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
mode: {
|
|
|
type: String
|
|
|
},
|
|
|
- gutter: Boolean
|
|
|
+ gutter: Boolean,
|
|
|
+ showTitle: Boolean
|
|
|
})
|
|
|
const emits = defineEmits(['change', 'click', 'transition'])
|
|
|
|
|
@@ -124,6 +128,18 @@ const handleClick = item => {
|
|
|
&-item{
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+
|
|
|
+ &-text{
|
|
|
+ position: absolute;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ bottom: 0;
|
|
|
+ background-color: rgba(0, 0, 0, .5);
|
|
|
+ color: #fff;
|
|
|
+ padding: 10rpx 20rpx;
|
|
|
+ font-size: 14px;
|
|
|
+ z-index: 10;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -131,6 +147,7 @@ const handleClick = item => {
|
|
|
.fs-swiper-item-box{
|
|
|
width: 610rpx !important;
|
|
|
left: 70rpx;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
.fs-swiper-item{
|
|
|
transform: scale(.9);
|