<template>
  <div class="box" id="myDiv">
    <div v-for="item in growCardList" :key="item.title" class="item">
      <img :src="item.image" class="getStyle" />
      <div class="text-center w-100">
        <p class="card-name">{{ item.name }}</p>
        <p class="card-content">{{ item.content }}</p>
        <a-button type="primary" @click="item.func">{{ item.btnName }}</a-button>
      </div>
    </div>
  </div>
</template>
<script lang="ts" setup>
  defineProps({
    growCardList: {
      type: [Array] as PropType<any[]>,
      required: true, //表格配置json
    },
  });
</script>
<style lang="less" scoped>
  :deep(.ant-card:last-child) {
    margin-right: 0 !important;
  }

  .card-name {
    font-size: 16px;
    font-weight: 600;
    margin: 0;
    margin-bottom: 10px;
  }

  .card-content {
    color: #999;
    margin-bottom: 36px;
  }

  :deep(.ant-btn) {
    width: 150px;
    height: 45px;
    background: #5e95ff;
    box-shadow: 0 4px 18px 0 rgb(94 149 255 / 50%);
    border-radius: 0 30px 30px;
    border-color: transparent;
  }

  .box {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    padding-right: 24px;
    padding-bottom: 24px;

    .item {
      width: calc((100% - 48px) / 2);
      height: calc((100vh - 162px) / 2);
      margin: 24px 0 0 24px;
      background-color: #fff;
      display: flex;
      //flex-direction: column;
      justify-content: center;
      align-items: center;
      border: 1px solid #eee;
      border-radius: 16px;
      flex-wrap: wrap;
    }
  }

  .getStyle {
    width: 370px; //calc(50vw - 432px);
  }
</style>
