no-data.vue 768 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <template>
  2. <view class="no_data" :class="{ 'no_data_centered': centered }">
  3. <image class="no_data_img" src="@/static/image/bg/no_data.png"></image>
  4. <text class="no_data_text">{{text}}</text>
  5. </view>
  6. </template>
  7. <script setup>
  8. const props = defineProps({
  9. text:{
  10. type: String,
  11. default: '暂无数据'
  12. },
  13. centered:{
  14. type: Boolean,
  15. default: false
  16. }
  17. })
  18. </script>
  19. <style scoped lang="scss">
  20. .no_data{
  21. display: flex;
  22. flex-direction: column;
  23. justify-content: center;
  24. align-items: center;
  25. height: 362rpx;
  26. .no_data_img{
  27. width: 464rpx;
  28. height: 278rpx;
  29. }
  30. .no_data_text{
  31. color: #999999;
  32. font-weight: 400;
  33. font-size: 24rpx;
  34. line-height: 36rpx;
  35. }
  36. }
  37. .no_data_centered{
  38. flex: 1;
  39. height: auto;
  40. min-height: 0;
  41. }
  42. </style>