<template>
  <div class="container">
    <div class="label">
      {{label}}
    </div>
    <div class="value" :style="valueColor">
      {{value}}
    </div>
  </div>
</template>

<script>
  export default {
    name: 'data-statistics-item',
    props: {
      label: {
        type: String,
        default: '待完成'
      },
      value: {
        type: [String, Number],
        default: '28'
      },
      color: {
        type: String,
        default: '#000'
      }
    },
    computed: {
      valueColor() {
        return {
          color: this.color
        };
      }
    }
  };
</script>

<style lang="less" scoped>
  .container {
    padding: 10px;
    font-family: Chinese Quote,-apple-system,BlinkMacSystemFont,Segoe UI,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;
    font-variant: tabular-nums;
    display: flex;
    flex-direction: column;

    .label {
      color: rgba(0, 0, 0, .45);
      font-size: 14px;
      line-height: 22px;
    }
    .value{
      overflow: hidden;
      text-overflow: ellipsis;
      word-break: break-all;
      white-space: nowrap;
      color: #000;
      margin-top: 4px;
      margin-bottom: 0;
      font-size: 30px;
      line-height: 38px;
      height: 38px;
    }
  }
</style>
