金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.1 KiB

  1. <template>
  2. <view class="empty-box" style="margin: 100rpx 0;text-align: center;">
  3. <view class="empty-image">
  4. <image :src="src" mode="aspectFill" style="margin: 0 auto;width: 520rpx;"></image>
  5. </view>
  6. <view class="content m-text-center m-m-t-20">
  7. <view class="m-font-32" style="color: #777777;">{{ text }}</view>
  8. </view>
  9. <button class="m-m-t-32 empty-button" v-if="showButton" @click="$emit('clickButton')">{{ buttonTitle }}</button>
  10. </view>
  11. </template>
  12. <script>
  13. export default {
  14. name:"lf-empty",
  15. props: {
  16. text: {
  17. type: String, // 空消息提示语
  18. default: '暂无数据'
  19. },
  20. src: {
  21. type: String, // 空消息提示的图片
  22. default: ''
  23. },
  24. showButton: {
  25. type: Boolean, // 是否显示按钮
  26. default: false
  27. },
  28. buttonTitle: {
  29. type: String, // 按钮上的文字,当showButton == true时显示
  30. default: '去逛逛'
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. .empty-button{
  37. min-width: 170rpx;
  38. max-width: max-content;
  39. height: 68rpx;
  40. background-color: #FEFEFE;
  41. font-size: 30rpx;
  42. color: #666666;
  43. line-height: 66rpx;
  44. text-align: center;
  45. border-radius: 6rpx;
  46. border: 2rpx solid #E4E4E4;
  47. }
  48. </style>