| | |
| | | |
| | | <template #empty> |
| | | <div v-if="loading"></div> |
| | | <ElEmpty v-else :description="emptyText" :image-size="120" /> |
| | | <ElEmpty v-else :description="resolvedEmptyText" :image-size="120" /> |
| | | </template> |
| | | </ElTable> |
| | | |
| | |
| | | |
| | | <script setup> |
| | | import { ref, computed, nextTick, watchEffect, getCurrentInstance, useAttrs } from 'vue' |
| | | import { useI18n } from 'vue-i18n' |
| | | import { storeToRefs } from 'pinia' |
| | | import { useTableStore } from '@/store/modules/table' |
| | | import { useCommon } from '@/hooks/core/useCommon' |
| | |
| | | const elTableRef = ref(null) |
| | | const paginationRef = ref() |
| | | const tableHeaderRef = ref() |
| | | const { t } = useI18n() |
| | | const tableStore = useTableStore() |
| | | const { isBorder, isZebra, tableSize, isFullScreen, isHeaderBackground } = storeToRefs(tableStore) |
| | | const props = defineProps({ |
| | |
| | | border: { required: false, default: void 0 }, |
| | | size: { required: false, default: void 0 }, |
| | | emptyHeight: { required: false, default: '100%' }, |
| | | emptyText: { required: false, default: '暂无数据' }, |
| | | emptyText: { required: false, default: '' }, |
| | | showTableHeader: { required: false, default: true } |
| | | }) |
| | | const instance = getCurrentInstance() |
| | |
| | | : void 0 |
| | | })) |
| | | const showPagination = computed(() => props.pagination && !isEmpty.value) |
| | | const resolvedEmptyText = computed(() => props.emptyText || t('table.emptyText')) |
| | | const shouldRenderSlotScope = (slotScope) => { |
| | | return slotScope.$index === void 0 || slotScope.$index >= 0 |
| | | } |