<template>
  <div class="empty">
    <div
      class="content"
      :style="{ width: width.includes('px') ? width : width + 'px' }"
    >
      <img v-if="img" :src="img" />
      <span v-if="text">
        {{ text }}
      </span>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    width: {
      type: [String, Number],
      default: "200",
    },
    img: {
      type: String,
      default: require("@/assets/img/no_data@2x.png"),
    },
    text: {
      type: String,
      default: "",
    },
  },
};
</script>

<style lang="less" scoped>
.empty {
  display: flex;
  align-items: center;
  justify-content: center;
  img {
    width: 100%;
  }
  .content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
}
</style>
