mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-16 21:18:05 +01:00
feat(Divider): handle size prop (#1307)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
@@ -26,7 +26,7 @@ import UIcon from '../elements/Icon.vue'
|
||||
import UAvatar from '../elements/Avatar.vue'
|
||||
import { useUI } from '../../composables/useUI'
|
||||
import { mergeConfig } from '../../utils'
|
||||
import type { Avatar, Strategy } from '../../types'
|
||||
import type { Avatar, DividerSize, Strategy } from '../../types'
|
||||
// @ts-expect-error
|
||||
import appConfig from '#build/app.config'
|
||||
import { divider } from '#ui/ui.config'
|
||||
@@ -52,6 +52,13 @@ export default defineComponent({
|
||||
type: Object as PropType<Avatar>,
|
||||
default: null
|
||||
},
|
||||
size: {
|
||||
type: String as PropType<DividerSize>,
|
||||
default: () => config.default.size,
|
||||
validator (value: string) {
|
||||
return Object.keys(config.border.size.horizontal).includes(value) || Object.keys(config.border.size.vertical).includes(value)
|
||||
}
|
||||
},
|
||||
orientation: {
|
||||
type: String as PropType<'horizontal' | 'vertical'>,
|
||||
default: 'horizontal',
|
||||
@@ -92,7 +99,7 @@ export default defineComponent({
|
||||
return twJoin(
|
||||
ui.value.border.base,
|
||||
ui.value.border[props.orientation],
|
||||
ui.value.border.size[props.orientation],
|
||||
ui.value.border.size[props.orientation][props.size],
|
||||
ui.value.border.type[props.type]
|
||||
)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user