index.vue 523 B

12345678910111213141516171819202122232425262728293031
  1. <template>
  2. <van-empty :image="imageSrc" :description="description" />
  3. </template>
  4. <script>
  5. import { mapGetters } from 'vuex'
  6. export default {
  7. name: 'simple-empty',
  8. props: {
  9. image: {
  10. type: String,
  11. default: '',
  12. },
  13. name: {
  14. type: String,
  15. default: '',
  16. },
  17. description: {
  18. type: String,
  19. default: '描述文字',
  20. },
  21. },
  22. computed: {
  23. ...mapGetters(['static']),
  24. imageSrc() {
  25. return this.image || this.static + '/' + this.name
  26. },
  27. },
  28. }
  29. </script>