<template>
  <div class="FormItem">
    <div class="FormItem-label">{{label}}</div>
    <div :class="['FormItem-content', size]">
      <slot></slot>
    </div>
  </div>
</template>

<script>
export default {
  name: 'form-item',
  props: {
    label: {
      type: String,
      default: '属性',
    },
    size: {
      type: String,
      default: 'normal',
    },
  },
};
</script>

<style lang="scss">
@import '../../assets/styles/variables.scss';

.FormItem {
  display: flex;
  font-size: 12px;
  color: #333;
  & + & {
    margin-left: 25px;
  }
  .FormItem-label {
    position: relative;
    width: 57px;
    text-align: justify;
    text-align-last: justify;
    &::after {
      content: ':';
      position: absolute;
      right: -5px;
    }
  }
  .FormItem-content {
    margin-left: 10px;
    &.big {
      width: 210px;
    }
    &.normal {
      width: 144px;
    }
    &small {
      width: 120px;
    }
  }
}
@media screen and (min-width: $bigScreenWidth) {
  .FormItem {
    font-size: 18px;
    & + & {
      margin-left: 40px;
    }
    .FormItem-label {
      width: 77px;
    }
    .FormItem-content {
      margin-left: 20px;
      &.big {
        width: 240px;
      }
      &.normal {
        width: 174px;
      }
      &small {
        width: 150px;
      }
    }
  }
}
</style>

