empty-show.vue 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <view class="empty-main" :style="{'height':heightPrecent}">
  3. <view class="empty-image" v-if="!onlyText">
  4. <image src="@/static/list-emptys.png" mode=""></image>
  5. </view>
  6. <text :style="`font-size: ${size}`">{{showText}}</text>
  7. </view>
  8. </template>
  9. <script setup>
  10. const props = defineProps({
  11. onlyText: {
  12. type: Boolean,
  13. default: false
  14. },
  15. heightPrecent: {
  16. type: String,
  17. default: "100%"
  18. },
  19. showText: {
  20. type: String,
  21. default: "列表为空"
  22. },
  23. size:{
  24. type: String,
  25. default: '36rpx'
  26. }
  27. })
  28. </script>
  29. <style lang="scss" scoped>
  30. .empty-main {
  31. display: flex;
  32. flex-direction: column;
  33. justify-content: center;
  34. width: 100%;
  35. // height: 100%;
  36. text-align: center;
  37. font-weight: 700;
  38. color: #8798B6;
  39. .empty-image {
  40. width: 378rpx;
  41. height: 292rpx;
  42. margin: 0 auto;
  43. image {
  44. width: 100%;
  45. height: 100%
  46. }
  47. }
  48. }
  49. </style>