TableEmpty.vue 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <script setup lang="ts">
  2. import { computed } from 'vue'
  3. import lightPng from './image/default_notification_setting@2x.png'
  4. import darkPng from './image/default_notification_setting@2x.png'
  5. import { useThemeStore } from '@/stores/modules/theme'
  6. const themeStore = useThemeStore()
  7. // 判断当前系统主题模式
  8. const emptyImg = computed(() => {
  9. return themeStore.theme === 'dark' ? darkPng : lightPng
  10. })
  11. const props = defineProps({
  12. EmptyTitle: String
  13. })
  14. </script>
  15. <template>
  16. <div class="v-empty">
  17. <div class="empty-img">
  18. <img :src="emptyImg" alt="" style="width: 100px;" />
  19. </div>
  20. <p class="title">
  21. <slot name="title">{{ props.EmptyTitle }}</slot>
  22. </p>
  23. <div>
  24. <slot name="suggestion"></slot>
  25. </div>
  26. </div>
  27. </template>
  28. <style lang="scss" scoped>
  29. .v-empty {
  30. display: flex;
  31. flex-direction: column;
  32. align-items: center;
  33. .empty-img {
  34. margin-bottom: 16px;
  35. }
  36. .title {
  37. margin-bottom: 8px;
  38. font-weight: 400;
  39. color: var(--color-neutral-2);
  40. }
  41. }
  42. </style>