index.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <view class="jnpf-empty" :style="{'z-index':zIndex}">
  3. <view class="u-flex-col jnpf-empty-inner">
  4. <image :src="getImageUrl" class="jnpf-empty-inner-img"></image>
  5. <text class="jnpf-empty-inner-text">{{description||$t('common.noData')}}</text>
  6. </view>
  7. </view>
  8. </template>
  9. <script>
  10. import resources from '@/libs/resources'
  11. export default {
  12. name: 'jnpf-empty',
  13. props: {
  14. zIndex: {
  15. type: [String, Number],
  16. default: 999
  17. },
  18. image: {
  19. type: String,
  20. default: ''
  21. },
  22. description: {
  23. type: String,
  24. default: ''
  25. },
  26. },
  27. data() {
  28. return {
  29. icon: resources.message.nodata,
  30. }
  31. },
  32. computed: {
  33. getImageUrl() {
  34. return this.image || this.icon
  35. }
  36. }
  37. }
  38. </script>
  39. <style lang="scss">
  40. .jnpf-empty {
  41. display: flex;
  42. justify-content: center;
  43. align-items: center;
  44. .jnpf-empty-inner {
  45. width: 154px;
  46. height: 170px;
  47. align-items: center;
  48. .jnpf-empty-inner-text {
  49. padding: 30rpx 0;
  50. color: #909399;
  51. }
  52. .jnpf-empty-inner-img {
  53. width: 100%;
  54. height: 100%;
  55. }
  56. }
  57. }
  58. </style>