<template>
  <div class="custom-recommend">
    <div class="recommend-title">{{ label }}</div>
    <div class="recommend-content">
      <template v-for="(item, index) in list" :key="index">
        <CustomCard
          :img="item.image"
          :title="item.title"
          :content="item.description"
          @click="toGenerate(item)"
        ></CustomCard>
      </template>
    </div>
  </div>
</template>

<script lang="ts" setup>
import CustomCard from '@/components/card.vue';
const props = defineProps<{
  list: any[];
  label: string;
}>();
const emit = defineEmits(['change']);
const toGenerate = (item: any) => {
  // 判断类型跳转页面
  emit('change', item);
};
</script>

<style lang="less">
@import '@/style/variables.less';
.custom-recommend {
  margin-top: 30px;
  padding: 0 48px;
  box-sizing: border-box;
  .recommend-title {
    font-weight: 700;
    font-size: @font-size-20;
    color: #ffffff;
  }
  .recommend-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    row-gap: 30px;
    margin-top: 20px;
    box-sizing: border-box;
    & > * {
      width: 48%;
    }
  }
}
</style>
