Empty.vue 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div class="empty-container">
  3. <div class="empty-content-position">
  4. <el-image :src="require('@/assets/images/empty.png')"></el-image>
  5. <div class="empty-main">
  6. <slot name="default">{{ defaultTip }}</slot>
  7. </div>
  8. </div>
  9. </div>
  10. </template>
  11. <script>
  12. import { Image } from 'element-ui'
  13. export default {
  14. name: 'empty',
  15. components: {
  16. [Image.name]: Image
  17. },
  18. data () {
  19. return {
  20. defaultTip: '这里什么也没有'
  21. }
  22. }
  23. }
  24. </script>
  25. <style lang="scss" scoped>
  26. .empty-container {
  27. display: flex;
  28. flex-direction: column;
  29. align-items: center;
  30. justify-content: center;
  31. flex: 1;
  32. padding: 16px;
  33. box-sizing: border-box;
  34. .empty-content-position {
  35. display: flex;
  36. align-items: center;
  37. flex-direction: column;
  38. justify-content: center;
  39. }
  40. .mt50 {
  41. margin-top: -50px;
  42. }
  43. .empty-main {
  44. @extend .empty-content-position;
  45. margin-top: 10px;
  46. text-align: center;
  47. color: #999;
  48. font-size: 14px;
  49. line-height: 22px;
  50. }
  51. .el-image {
  52. width: 160px;
  53. height: 160px;
  54. }
  55. }
  56. </style>