mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-19 22:41:42 +01:00
feat(AvatarGroup): new component (#71)
Co-authored-by: Romain Hamel <romain@boilr.io>
This commit is contained in:
12
src/runtime/composables/useAvatarGroup.ts
Normal file
12
src/runtime/composables/useAvatarGroup.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { inject, provide, computed, type ComputedRef } from 'vue'
|
||||
import type { AvatarGroupProps } from '#ui/types'
|
||||
|
||||
export function useAvatarGroup(props: { size: AvatarGroupProps['size'] }) {
|
||||
const injectedSize = inject<ComputedRef<AvatarGroupProps['size']> | undefined>('avatar-size', undefined)
|
||||
const size = computed(() => props.size ?? injectedSize?.value)
|
||||
provide('avatar-size', size)
|
||||
|
||||
return {
|
||||
size
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user