Empty.vue 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div class="empty-container">
  3. <div class="empty-content-position mt50">
  4. <div class="image" :class="state"></div>
  5. <div class="empty-main">
  6. <slot name="default"></slot>
  7. </div>
  8. </div>
  9. </div>
  10. </template>
  11. <script lang="ts">
  12. import { Component, Vue, Prop } from 'vue-property-decorator'
  13. // @ is an alias to /src
  14. @Component({
  15. name: 'empty'
  16. })
  17. export default class Empty extends Vue {
  18. @Prop({ default: 'empty-image' }) state?: string | undefined;
  19. }
  20. </script>
  21. <style lang="scss">
  22. .empty-container {
  23. display: flex;
  24. flex-direction: column;
  25. align-items: center;
  26. justify-content: center;
  27. flex: 1;
  28. height: 100%;
  29. padding: 16px;
  30. box-sizing: border-box;
  31. background-color: rgba(245, 244, 249, 1);
  32. .empty-content-position {
  33. display: flex;
  34. align-items: center;
  35. flex-direction: column;
  36. justify-content: center;
  37. }
  38. .mt50 {
  39. margin-top: -50px;
  40. }
  41. .empty-main {
  42. @extend .empty-content-position;
  43. text-align: center;
  44. }
  45. .max-width70 {
  46. width: 70%;
  47. }
  48. .max-width80 {
  49. width: 80%;
  50. }
  51. .tip-text {
  52. color: #5F5E64;
  53. font-size: 14px;
  54. line-height: 20px;
  55. text-align: center;
  56. }
  57. .tip-sub-text {
  58. color: #9B9CA3;
  59. font-size: 13px;
  60. line-height: 20px;
  61. margin-top: 6px;
  62. text-align: center;
  63. }
  64. .image {
  65. width: 160px;
  66. height: 160px;
  67. }
  68. .empty-image {
  69. background: url(~@/assets/image/jy-back.png) no-repeat;
  70. background-size: contain;
  71. }
  72. }
  73. </style>