<template>
  <div class="ht-base-descriptions">
    <div class="descriptions-wrapper">
      <div class="descriptions-title" v-if="title">{{title}}</div>
      <div :class="descriptionsContent">
        <table>
          <tbody>
            <slot></slot>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    name: 'HtBaseDescriptions',
    props: {
      //标题
      title: {
        type: String
      },
      //每行有几列
      column: {
        type: Number,
        default: 3
      },
      bordered: {
        type: Boolean,
        default: false
      },
      layout: {
        type: String,
        default: 'horizontal'
      },
      itemHeight: {
        type: String,
        default: '40px'
      }

    },
    computed: {
      descriptionsContent() {
        return {
          [`descriptions-content`]: true,
          [`descriptions-content-border`]: this.bordered ? true : false
        }
      }
    }
  }
</script>
<style lang="less">
  .ht-base-descriptions {
    .descriptions-title {
      height: 40px;
      line-height: 40px;
      font-size: 16px;
      color: #333333;
      font-weight: 500;
    }
    .descriptions-content-border {
      border-top: 1px solid #cccccc;
      border-left: 1px solid #cccccc;
    }
    .descriptions-content {
      .label {
        display: inline-block;
        height: 100%;
        line-height: 40px;
        color: #333333;
        font-size:  14px;
      }
      .value {
        display: inline-block;
        padding-left: 10px;
      }
    }
  }
</style>

