index.vue 902 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <template>
  2. <view
  3. v-if="show" class="empty-content" :style="{
  4. paddingTop: paddingTop + 'rpx',
  5. background
  6. }"
  7. >
  8. <image :src="iconUrl" />
  9. <p class="tips">
  10. <slot>
  11. 暂无数据~
  12. </slot>
  13. </p>
  14. </view>
  15. </template>
  16. <script>
  17. export default {
  18. name: 'Empty',
  19. props: {
  20. show: {
  21. type: Boolean,
  22. default: false
  23. },
  24. paddingTop: {
  25. type: Number,
  26. default: () => 500
  27. },
  28. background: {
  29. type: String,
  30. default: () => '#f8f8f8'
  31. },
  32. iconUrl: {
  33. type: String,
  34. default: () => require('../../static/images/origin/searchEmpty.png')
  35. }
  36. },
  37. data() {
  38. return {}
  39. },
  40. computed: {
  41. },
  42. methods: {}
  43. }
  44. </script>
  45. <style
  46. lang="scss"
  47. scoped
  48. >
  49. .empty-content {
  50. display: flex;
  51. justify-content: center;
  52. flex-direction: column;
  53. align-items: center;
  54. image {
  55. width: 150rpx;
  56. height: 150rpx;
  57. }
  58. .tips {
  59. margin-top: 25rpx;
  60. font-weight: bolder;
  61. }
  62. }
  63. </style>