File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 3131 :item =" item" :column =" column"
3232 >
3333 </slot >
34- <span v-else >
34+ <span v-else-if = " !isLoading " >
3535 {{ item[column.fieldName] }}
3636 </span >
37+ <div v-else >
38+ <div class =" h-5 w-full" >
39+ <Skeleton class =" h-4" />
40+ </div >
41+ </div >
3742 </td >
3843 </tr >
3944 </tbody >
7580<script setup lang="ts">
7681 import { ref , type Ref , computed } from ' vue' ;
7782 import { asyncComputed } from ' @vueuse/core' ;
78- import { IconArrowRightOutline , IconArrowLeftOutline } from ' @iconify-prerendered/vue-flowbite ' ;
83+ import { Skeleton } from ' @/afcl ' ;
7984
8085 const props = withDefaults (
8186 defineProps <{
95100 );
96101
97102 const currentPage = ref (1 );
103+ const isLoading = ref (false );
98104
99105 const dataResult = asyncComputed ( async () => {
100106 if (typeof props .data === ' function' ) {
101- return await props .data (currentPage .value , props .pageSize );
107+ isLoading .value = true ;
108+ const result = await props .data (currentPage .value , props .pageSize );
109+ isLoading .value = false ;
110+ return result ;
102111 }
103112 const start = (currentPage .value - 1 ) * props .pageSize ;
104113 const end = start + props .pageSize ;
You can’t perform that action at this time.
0 commit comments