feat(web): adopt vuesax icons and shared skeleton loading
Replace the inline SVG icon set with the vuesax linear pack, add skeleton primitives for loading states, and keep page scroll inside the app shell. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, toRef } from 'vue';
|
||||
import { Skeleton, theme } from 'ant-design-vue';
|
||||
import { useCrmSkeletonLoading } from './context';
|
||||
|
||||
const ASkeletonAvatar = Skeleton.Avatar;
|
||||
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
loading?: boolean;
|
||||
size?: number;
|
||||
shape?: 'circle' | 'square';
|
||||
}>(),
|
||||
{ size: 40, shape: 'circle' },
|
||||
);
|
||||
|
||||
const { token } = theme.useToken();
|
||||
const isLoading = useCrmSkeletonLoading(toRef(props, 'loading'));
|
||||
|
||||
const sizePx = computed(() => props.size ?? token.value.controlHeightLG ?? 40);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<a-skeleton-avatar
|
||||
v-if="isLoading"
|
||||
active
|
||||
:size="sizePx"
|
||||
:shape="shape"
|
||||
/>
|
||||
<slot v-else />
|
||||
</template>
|
||||
Reference in New Issue
Block a user