mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
chore(AvatarGroup): enhance avatars overlap (#75)
This commit is contained in:
committed by
GitHub
parent
541ed304a0
commit
3e9c502fbe
@@ -1,5 +1,11 @@
|
||||
<template>
|
||||
<div class="flex">
|
||||
<div class="flex flex-row-reverse">
|
||||
<Avatar
|
||||
v-if="remainingGroupSize > 0"
|
||||
:size="size"
|
||||
:text="`+${remainingGroupSize}`"
|
||||
:class="avatarClass"
|
||||
/>
|
||||
<Avatar
|
||||
v-for="(avatar, index) of displayedGroup"
|
||||
:key="index"
|
||||
@@ -7,12 +13,6 @@
|
||||
:size="size"
|
||||
:class="avatarClass"
|
||||
/>
|
||||
<Avatar
|
||||
v-if="remainingGroupSize > 0"
|
||||
:size="size"
|
||||
:text="`+${remainingGroupSize}`"
|
||||
:class="avatarClass"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -55,9 +55,9 @@ const avatars = computed(() => {
|
||||
})
|
||||
|
||||
const displayedGroup = computed(() => {
|
||||
if (!props.max) { return avatars.value }
|
||||
if (!props.max) { return [...avatars.value].reverse() }
|
||||
|
||||
return avatars.value.slice(0, props.max)
|
||||
return avatars.value.slice(0, props.max).reverse()
|
||||
})
|
||||
|
||||
const remainingGroupSize = computed(() => {
|
||||
|
||||
@@ -383,7 +383,7 @@ export default (variantColors: string[]) => {
|
||||
|
||||
const avatarGroup = {
|
||||
ring: 'ring-2 u-ring-white',
|
||||
margin: '-ml-1.5 first:ml-0'
|
||||
margin: '-mr-1.5 first:mr-0'
|
||||
}
|
||||
|
||||
const slideover = {
|
||||
|
||||
Reference in New Issue
Block a user