<script setup lang="ts">
import BorderBox from '@/components/BorderBox'
import ContainerTitle from './modules/ContainerTitle.vue'
import borderImage from '@/assets/images/border.default.png'
import defaultBorderImg from '@/assets/images/border-bg.default.png'

// 定义参数
interface ContainerBoxProps {
  title: string
  background?: any
  border?: any
}

// 获取参数
const props = withDefaults(defineProps<ContainerBoxProps>(), {
  background: defaultBorderImg,
  border: borderImage
});
</script>

<template>
  <div class="container-box">
    <BorderBox :style="{ backgroundImage: `url(${props.background})` }" class="border-box" :width="[1.3,1.3,1.3,1.3]" :padding="[]" :slice="[25,25,25,25]" :source="props.border">
      <ContainerTitle :title="props.title" />
      <div class="container-content">
        <slot />
      </div>
    </BorderBox>
  </div>
</template>

<style scoped lang="less">
.container-box {
  width: 100%;
  height: 100%;
  margin: 1.2vh 0px;
  overflow: hidden;

  .border-box {
    background: no-repeat center center;
    background-size: 100% 100%;
  }
}
</style>