index.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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="scaleToFill"></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: false
  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. height: 184rpx;
  56. }
  57. }
  58. </style>