refactor(frontend): 优化 UI 基础组件

- 添加默认 class 属性支持
- 改进组件类型定义
- 优化属性配置
This commit is contained in:
fawney19
2025-12-12 20:21:50 +08:00
parent a73e0d51db
commit d8516e42ea
7 changed files with 12 additions and 2 deletions

View File

@@ -10,6 +10,8 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
class: undefined,
src: undefined,
alt: ''
})

View File

@@ -5,6 +5,7 @@ import { computed } from 'vue'
const props = withDefaults(defineProps<Props>(), {
variant: 'default',
class: undefined,
})
const badgeVariants = cva(

View File

@@ -25,6 +25,7 @@ const props = withDefaults(defineProps<Props>(), {
variant: 'default',
size: 'default',
disabled: false,
class: undefined,
type: 'button'
})

View File

@@ -14,7 +14,8 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
variant: 'default'
variant: 'default',
class: undefined,
})
// 标准卡片变体定义

View File

@@ -35,8 +35,12 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
class: undefined,
position: 'popper',
side: undefined,
sideOffset: 4,
align: undefined,
alignOffset: undefined,
})
const contentClass = computed(() =>

View File

@@ -5,7 +5,7 @@ interface Props {
placeholder?: string
}
const props = defineProps<Props>()
defineProps<Props>()
</script>
<template>

View File

@@ -10,6 +10,7 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
class: undefined,
orientation: 'horizontal',
decorative: true,
})