index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view v-if="!isLoading" class="empty-content" :style="customStyle">
  3. <view class="empty-icon">
  4. <image class="image" src="/static/empty.png" mode="widthFix"></image>
  5. </view>
  6. <view class="tips">{{ tips }}</view>
  7. <slot name="slot"></slot>
  8. </view>
  9. </template>
  10. <script>
  11. export default {
  12. /**
  13. * 组件的属性列表
  14. * 用于组件自定义设置
  15. */
  16. props: {
  17. // 正在加载
  18. isLoading: {
  19. type: Boolean,
  20. default: true
  21. },
  22. // 自定义样式
  23. customStyle: {
  24. type: Object,
  25. default () {
  26. return {}
  27. }
  28. },
  29. // 提示的问题
  30. tips: {
  31. type: String,
  32. default: '亲,暂无相关数据'
  33. }
  34. },
  35. data() {
  36. return {}
  37. },
  38. methods: {
  39. }
  40. }
  41. </script>
  42. <style lang="scss" scoped>
  43. .empty-content {
  44. box-sizing: border-box;
  45. width: 100%;
  46. padding: 140rpx 50rpx;
  47. text-align: center;
  48. .tips {
  49. font-size: 28rpx;
  50. color: gray;
  51. margin: 50rpx 0;
  52. }
  53. .empty-icon .image {
  54. width: 280rpx;
  55. }
  56. }
  57. </style>