<template>
  <div class="empty">
    <div :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/暂无信息／暂无列表@3x.png"),
    },
    text: {
      type: String,
      default: "",
    },
  },
};
</script>

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