en-blank.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="blank-page" v-if="showBlank">
  3. <view class="blank-img-box">
  4. <text class="iconfont">
  5. &#xe614;
  6. </text>
  7. </view>
  8. <view class="blank-text">
  9. <text>{{$t('error.no')}}!</text>
  10. </view>
  11. <view class="blank-button" @click="btnClick" v-if="showButton">
  12. <slot name="button">
  13. <view class="default-button">
  14. {{buttonText}}
  15. </view>
  16. </slot>
  17. </view>
  18. </view>
  19. </template>
  20. <script>
  21. /**
  22. * 组件根据文档定位至最中部分,层级为 2
  23. * 背景并非全部覆盖,请根据需求显示隐藏
  24. * 自定义图片的时候需要自己写尺寸
  25. * */
  26. export default {
  27. props: {
  28. showBlank: {
  29. type: Boolean,
  30. default: true
  31. },
  32. message: {
  33. type: String,
  34. default: '暂无数据!'
  35. },
  36. buttonText: {
  37. type: String,
  38. default: '按钮文字'
  39. },
  40. showButton: {
  41. type: Boolean,
  42. default: false
  43. },
  44. },
  45. data() {
  46. return {
  47. }
  48. },
  49. methods: {
  50. btnClick() {
  51. this.$emit('btnClick')
  52. }
  53. },
  54. }
  55. </script>
  56. <style scoped lang="scss">
  57. @import url("../../static/css/en-common.css") ;
  58. .blank-page {
  59. width: 100%;
  60. padding-top: 100rpx;
  61. z-index: 2;
  62. display: flex;
  63. flex-direction: column;
  64. align-items: center;
  65. }
  66. .blank-img-box {
  67. display: flex;
  68. justify-content: center;
  69. width: 100%;
  70. .iconfont{
  71. font-size: 130rpx;
  72. color: #AAAAAA;
  73. }
  74. }
  75. .blank-img {
  76. display: block;
  77. width: 193px;
  78. height: 131px;
  79. }
  80. .blank-text {
  81. margin-top: 5px;
  82. margin-bottom: 32px;
  83. text{
  84. font-size: 14px;
  85. color: #AAAAAA;
  86. }
  87. }
  88. .default-button {
  89. width: 160px;
  90. height: 44px;
  91. background: rgb(52, 137, 255);
  92. box-shadow: 0px 2px 3px rgba(52, 137, 255, 0.29);
  93. border-radius: 22px;
  94. color: #fff;
  95. line-height: 44px;
  96. text-align: center;
  97. }
  98. </style>