You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
919 B
29 lines
919 B
<template>
|
|
<div :class="[prefixCls, `${prefixCls}--white`]">
|
|
<el-carousel indicator-position="outside">
|
|
<el-carousel-item v-for="item in bannerList" :key="item.id">
|
|
<a class="block w-full h-full" :target="item.link ? '_blank' : 'javascript:void(0)'" :href="item.link" >
|
|
<el-image class="w-full h-full" fit="cover" :src="item.image" alt="" />
|
|
</a>
|
|
</el-carousel-item>
|
|
</el-carousel>
|
|
<!-- <img src="~/assets/images/commonBanner.png" alt="" /> -->
|
|
<!-- <h2 class="title">{{ props.title }}</h2> -->
|
|
</div>
|
|
</template>
|
|
<script lang="ts" setup>
|
|
import commonApi from "~/api/Common";
|
|
|
|
const props = defineProps(['title']);
|
|
const { prefixCls } = useDesign('banner');
|
|
const bannerList = ref([]);
|
|
|
|
(async function getData() {
|
|
const {data} = await commonApi.getCarousel()
|
|
bannerList.value = data;
|
|
}())
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
@import 'banner';
|
|
</style>
|