Empty.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <section class="empty-container">
  3. <div class="empty-wrap">
  4. <img
  5. :src="showEmptyObj.imgUrl"
  6. class="photo">
  7. <p class="tips">{{ showEmptyObj.tips }}</p>
  8. </div>
  9. </section>
  10. </template>
  11. <script>
  12. export default {
  13. props: {
  14. emptyObj: {
  15. type: Object,
  16. required: false,
  17. default: () => {}
  18. }
  19. },
  20. data() {
  21. return {
  22. showEmptyObj: {
  23. imgUrl: '//static.hoolihome.com/pc/3.0.0/assets/img/v3.1/no-data.png',
  24. tips: this.$t('emptyTips')
  25. }
  26. }
  27. },
  28. created() {
  29. this.showEmptyObj = Object.assign(this.showEmptyObj, this.emptyObj)
  30. }
  31. }
  32. </script>
  33. <style lang="less" scoped>
  34. .empty-container {
  35. margin: 0 auto;
  36. .empty-wrap {
  37. display: flex;
  38. flex-flow: column nowrap;
  39. justify-content: center;
  40. align-items: center;
  41. max-width: 1200px;
  42. min-height: 400px;
  43. margin: 0 auto;
  44. .photo {
  45. width: 70px;
  46. }
  47. .tips {
  48. max-width: 200px;
  49. height: 22px;
  50. margin-top: 24px;
  51. font-size: 14px;
  52. font-family: PingFangSC-Regular;
  53. font-weight: 400;
  54. color: rgba(153, 153, 153, 1);
  55. text-align: center;
  56. line-height: 22px;
  57. }
  58. }
  59. }
  60. </style>