empty.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <template>
  2. <view class="empty-content" :style="{backgroundColor:backgroundColor}">
  3. <image class="empty-content-image" :src="StaticUrl + '/image/icon-empty@2x.png'" mode="aspectFit"></image>
  4. <text class="error-text">{{EmptyText}}</text>
  5. </view>
  6. </template>
  7. <script>
  8. export default {
  9. props: {
  10. backgroundColor:{
  11. type: String,
  12. default: '#F7F7F7'
  13. },
  14. src: {
  15. type: String,
  16. default: 'empty'
  17. },
  18. typeIndex:{
  19. type:String,
  20. default: 'empty'
  21. },
  22. navbarHeight:{
  23. type:Number
  24. }
  25. },
  26. data() {
  27. return {
  28. StaticUrl: this.$Static,
  29. EmptyText:'暂无数据',
  30. }
  31. },
  32. created(){
  33. if(this.typeIndex==0){
  34. this.EmptyText = '暂无数据'
  35. }else{
  36. this.EmptyText = '暂无数据'
  37. }
  38. },
  39. computed: {
  40. },
  41. }
  42. </script>
  43. <style lang="scss">
  44. .empty-content {
  45. display: flex;
  46. align-items: center;
  47. justify-content: center;
  48. flex-direction: column;
  49. margin: auto;
  50. height: 700rpx;
  51. z-index: 999;
  52. &-image {
  53. width: 100rpx;
  54. height: 100rpx;
  55. }
  56. .error-text{
  57. font-size: $font-size-28;
  58. color: #999999;
  59. line-height: 88rpx;
  60. }
  61. }
  62. </style>