<template>
|
<div class="homePage">
|
<el-carousel :height="screenheight + 'px'">
|
<el-carousel-item v-for="(item, index) in banner" :key="index">
|
<div class="bannerBox imgBox">
|
<img id="autoHeight" class="bannerImg" :src="item.icon" @click="bannerLink(item)" />
|
</div>
|
</el-carousel-item>
|
</el-carousel>
|
</div>
|
</template>
|
|
<script setup>
|
import { ref, onBeforeMount, inject, reactive, onMounted } from 'vue'
|
const MG = inject('MG')
|
|
let screenheight = ref(document.documentElement.clientHeight / 2)
|
const banner = reactive([])
|
const getBanner = () => {
|
MG.resource
|
.getItem({
|
path: 'banner\\homeBanner',
|
fields: { link: [] },
|
paging: { start: 0, size: 9 },
|
})
|
.then((res) => {
|
banner.push(...res.datas)
|
console.log(res.datas)
|
})
|
}
|
onMounted(() => {
|
getBanner()
|
})
|
</script>
|
|
<style lang="less" scoped>
|
.homePage {
|
min-width: 1220px;
|
min-height: calc(100vh - 61.8%);
|
background-color: #fff;
|
padding-bottom: 100px;
|
}
|
</style>
|