<template>
  <el-empty v-bind="emptyAttrs">
    <template #default>
      <slot></slot>
    </template>
  </el-empty>
</template>

<script setup lang="ts" name="CommonEmpty">
import { ElEmpty } from 'element-plus'
import type { EmptyProps } from 'element-plus'
import emptyImage from '@img/empty.png'
import { computed } from 'vue'

interface TEmptyProps extends Partial<EmptyProps> {}

const props = defineProps<TEmptyProps>()

const emptyAttrs = computed(() => {
  return Object.assign<TEmptyProps, TEmptyProps>(
    {
      image: emptyImage,
      imageSize: 180,
      description: '暂无数据',
    },
    props
  )
})
</script>

<style scoped lang="scss"></style>
