<!--
 * @Author: micky 1254597151@qq.com
 * @Date: 2023-08-14 15:56:31
 * @LastEditors: micky 1254597151@qq.com
 * @LastEditTime: 2023-09-11 11:14:27
 * @FilePath: \housekeeping-admin\src\views\decorate\component\widgets\banner\content.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
    <div class="banner mt-[8px]">
        <div class="banner-image">
            <decoration-img width="100%" height="180px" :src="getImage" fit="contain" />
        </div>
    </div>
</template>
<script lang="ts" setup>
import type { PropType } from 'vue'
import type options from './options'
import DecorationImg from '../../decoration-img.vue'
type OptionsType = ReturnType<typeof options>
const props = defineProps({
    content: {
        type: Object as PropType<OptionsType['content']>,
        default: () => ({})
    },
    styles: {
        type: Object as PropType<OptionsType['styles']>,
        default: () => ({})
    }
})

const getImage = computed(() => {
    const { data } = props.content
    if (Array.isArray(data)) {
        return data[0] ? data[0].image : ''
    }
    return ''
})
</script>

<style lang="scss" scoped>
.banner-image .el-image {
    // border-radius: 12px !important;
}
</style>
