<template>
  <div class="e-census-cards">
    <div
      class="card-foreach"
      v-for="(item, index) in propList"
      :key="index"
      :style="{
        width: `calc(100% / ${propList.length})`,
      }"
    >
      <div class="card-for-item">
        <div class="card-item-title">{{ item.label }}</div>
        <div class="card-item-value">{{ result[item.key] || 222 }}</div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: "ECensusCards",
  props: {
    propList: {
      type: Array,
      require: true,
    },
    result: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      list: [],
    };
  },
};
</script>
<style scoped lang="scss">
.e-census-cards {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  .card-foreach {
    width: 100%;
    height: 100%;
    display: flex;
    .card-for-item {
      width: 100%;
      height: 100%;
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      align-items: center;
      .card-item-title {
        display: flex;
        font-size: 14px;
        font-family: "Source Han Sans CN";
        font-weight: 400;
        color: #6b778c;
        width: 100%;
        height: 15px;
        justify-content: center;
      }
      .card-item-value {
        font-size: 24px;
        font-family: "Source Han Sans CN";
        font-weight: 500;
        color: #344567;
        width: 100%;
        justify-content: center;
        display: flex;
        margin-top: 15px;
      }
    }
  }
}
</style>
