fs-empty.vue 915 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <view class="fs-empty-box" :style="{ padding: padding }">
  3. <image :src="src" mode="widthFix" :style="{ width: imageWidth }"></image>
  4. <view class="content">{{ text }}</view>
  5. <slot></slot>
  6. </view>
  7. </template>
  8. <script>
  9. /**
  10. * 无数据组件
  11. * @description 无数据组件
  12. * @property {String} src 图片地址
  13. * @property {String} text 文字
  14. * @property {String} padding 内边距
  15. * @property {String} imageWidth 图片宽度
  16. */
  17. export default {
  18. name: 'fs-empty'
  19. }
  20. </script>
  21. <script setup>
  22. import empty from './empty.png'
  23. const props = defineProps({
  24. src: {
  25. type: String,
  26. default: empty
  27. },
  28. text: {
  29. type: String,
  30. default: '暂无数据'
  31. },
  32. padding: {
  33. type: String,
  34. default: '200rpx 30rpx'
  35. },
  36. imageWidth: {
  37. type: String,
  38. default: '400rpx'
  39. }
  40. })
  41. </script>
  42. <style lang="scss" scoped>
  43. .fs-empty-box {
  44. text-align: center;
  45. .content {
  46. margin-top: 20rpx;
  47. }
  48. }
  49. </style>