<template>
  <div>
    <van-empty :image="imageSrc" :description="description" v-if="imageSrc" />
    <van-empty :description="description" v-else />
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  name: 'simple-empty',
  props: {
    image: {
      type: String,
      default: '',
    },
    name: {
      type: String,
      default: '',
    },
    description: {
      type: String,
      default: '描述文字',
    },
  },
  computed: {
    ...mapGetters(['static']),
    imageSrc() {
      if (this.image) return this.image
      if (this.name) return '/' + this.name
      return ''
    },
  },
}
</script>
