empty.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <view class="empty-content">
  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. src: {
  11. type: String,
  12. default: 'empty'
  13. },
  14. typeIndex:{
  15. type:String,
  16. default: 'empty'
  17. },
  18. navbarHeight:{
  19. type:Number
  20. }
  21. },
  22. data() {
  23. return {
  24. StaticUrl: this.$Static,
  25. EmptyText:'暂无数据~',
  26. }
  27. },
  28. created(){
  29. if(this.typeIndex==0){
  30. this.EmptyText = '暂无数据~'
  31. }else{
  32. this.EmptyText = '暂无数据~'
  33. }
  34. },
  35. computed: {
  36. setSrc() {
  37. let url
  38. if(this.typeIndex==0){
  39. url = this.typeSrcall[this.src]
  40. }else{
  41. url = this.typeSrc[this.src]
  42. }
  43. return url
  44. },
  45. },
  46. }
  47. </script>
  48. <style lang="scss">
  49. .empty-content {
  50. display: flex;
  51. align-items: center;
  52. justify-content: center;
  53. flex-direction: column;
  54. margin: auto;
  55. background: $bg-color;
  56. height: 700rpx;
  57. z-index: 999;
  58. &-image {
  59. width: 200rpx;
  60. height: 200rpx;
  61. }
  62. .error-text{
  63. font-size: $font-size-28;
  64. color: #666666;
  65. line-height: 88rpx;
  66. }
  67. }
  68. </style>