SkeletonImage.vue 818 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <BaseBox
  3. v-bind="props"
  4. :inner-style="{
  5. ...themeStyles.skeletonImage.value,
  6. ...props.innerStyle,
  7. }"
  8. />
  9. </template>
  10. <script setup lang="ts">
  11. import { useTheme } from '@/components/theme/ThemeDefine';
  12. import { DynamicSize } from '@/components/theme/ThemeTools';
  13. import BaseBox, { type SleletonBaseBoxProps } from './SkeletonBaseBox.vue';
  14. const themeContext = useTheme();
  15. const themeStyles = themeContext.useThemeStyles({
  16. skeletonImage: {
  17. borderRadius: DynamicSize('SkeletonImageRadius', 10),
  18. },
  19. });
  20. /**
  21. * 图片占位组件
  22. */
  23. export interface SkeletonImageProps extends SleletonBaseBoxProps {
  24. }
  25. const props = withDefaults(defineProps<SkeletonImageProps>(), {
  26. });
  27. defineOptions({
  28. options: {
  29. virtualHost: true,
  30. styleIsolation: "shared",
  31. },
  32. });
  33. </script>