27 lines
550 B
Vue
27 lines
550 B
Vue
<script setup lang="ts">
|
|||
|
|
import { toRef } from 'vue';
|
||
|
|
import { Skeleton as ASkeleton } from 'ant-design-vue';
|
||
|
|
import { useCrmSkeletonLoading } from './context';
|
||
|
|
|
||
|
|
const props = withDefaults(
|
||
|
|
defineProps<{
|
||
|
|
loading?: boolean;
|
||
|
|
rows?: number;
|
||
|
|
width?: string | number | Array<string | number>;
|
||
|
|
}>(),
|
||
|
|
{ rows: 3 },
|
||
|
|
);
|
||
|
|
|
||
|
|
const isLoading = useCrmSkeletonLoading(toRef(props, 'loading'));
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<a-skeleton
|
||
|
|
v-if="isLoading"
|
||
|
|
active
|
||
|
|
:title="false"
|
||
|
|
:paragraph="{ rows, width }"
|
||
|
|
/>
|
||
|
|
<slot v-else />
|
||
|
|
</template>
|