<template>
  <div class="empty">
    <el-image :src="image" :fit="fit" :style="{ width: width, height: height }" />
    <div class="title" :style="{color: color}">{{ title }}</div>
    <div class="description">
      <slot name="description" />
    </div>
  </div>
</template>

<script>
export default {
  props: {
    image: {
      type: String,
      default: ''
    },
    fit: {
      validator: function(value) {
        return ['fill', 'contain', 'cover', 'none', 'scale-down'].indexOf(value) > -1
      },
      default: 'fill'
    },
    title: {
      type: String,
      default: '状态为空'
    },
    width: {
      type: String,
      default: '200px'
    },
    height: {
      type: String,
      default: '200px'
    },
    color: {
      type: String,
      default: '#000'
    }
  }
}
</script>

<style scoped lang="scss">
.empty {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  .title{
    font-weight: bold;
    margin-top: 16px;
  }
}
</style>
