20261008
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
<template>
|
||||
<el-carousel :height="`${height}px`" :style="{width: width}" class="m-a">
|
||||
<el-carousel-item v-for="(item, index) in list.swiper" :key="item" :style="{width: width}">
|
||||
<image class="carousel-img" :src="item" mode="scaleToFill" :style="{width: width}" @click="onClick(index)"/>
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CommonSwiper",
|
||||
props: {
|
||||
page: {
|
||||
type: String,
|
||||
default: "index"
|
||||
},
|
||||
height: {
|
||||
type: String | Number,
|
||||
default: "500"
|
||||
},
|
||||
width: {
|
||||
type: String,
|
||||
default: "100%"
|
||||
},
|
||||
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
vk.callFunction({
|
||||
url: 'client/album/pub/list',
|
||||
data: {
|
||||
page: this.page
|
||||
},
|
||||
success: res => {
|
||||
this.list = res
|
||||
console.log(this.list)
|
||||
}
|
||||
})
|
||||
},
|
||||
onClick(index) {
|
||||
// if (this.list.companyId) vk.navigateTo(`/pages/yellowPage/info?id=${this.list.companyId}`)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.carousel-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
margin: 0 auto;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user