StepItemInternalDotNumberIcon.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <template>
  2. <!-- 默认的圆点数字图标显示组件 -->
  3. <view :style="{
  4. display: 'flex',
  5. flexDirection: 'row',
  6. alignItems: 'center',
  7. justifyContent: 'center',
  8. width: themeContext.resolveSize(size - 4),
  9. height: themeContext.resolveSize(size - 4),
  10. borderStyle: 'solid',
  11. borderRadius: themeContext.resolveSize(size),
  12. borderColor: themeContext.resolveThemeColor(color),
  13. borderWidth: themeContext.resolveSize(borderWidth),
  14. }">
  15. <text :style="{
  16. color: themeContext.resolveThemeColor(color),
  17. fontSize: themeContext.resolveSize(size - 22),
  18. textAlign: 'center',
  19. }">
  20. {{ index }}
  21. </text>
  22. </view>
  23. </template>
  24. <script setup lang="ts">
  25. import { useTheme } from '@/components/theme/ThemeDefine';
  26. import { computed } from 'vue';
  27. defineProps({
  28. color: {
  29. type: String,
  30. default: 'currentColor',
  31. },
  32. size: {
  33. type: Number,
  34. default: 24,
  35. },
  36. index: {
  37. type: Number,
  38. default: 0,
  39. },
  40. })
  41. const themeContext = useTheme();
  42. const borderWidth = computed(() => themeContext.getVar('StepItemDotNumberIconBorderWidth', 3));
  43. </script>