empty.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <view class="empty-content" :style="{backgroundColor:backgroundColor}">
  3. <image class="empty-content-image" :src="StaticUrl + '/icon/icon-remarks-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. setSrc() {
  41. let url
  42. if(this.typeIndex==0){
  43. url = this.typeSrcall[this.src]
  44. }else{
  45. url = this.typeSrc[this.src]
  46. }
  47. return url
  48. },
  49. },
  50. }
  51. </script>
  52. <style lang="scss">
  53. .empty-content {
  54. display: flex;
  55. align-items: center;
  56. justify-content: center;
  57. flex-direction: column;
  58. margin: auto;
  59. height: 700rpx;
  60. z-index: 999;
  61. &-image {
  62. width: 200rpx;
  63. height: 200rpx;
  64. }
  65. .error-text{
  66. font-size: $font-size-28;
  67. color: #666666;
  68. line-height: 88rpx;
  69. }
  70. }
  71. </style>