mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-02-04 22:27:56 +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>
|
<template>
|
||||||
<div class="flex">
|
<div class="flex flex-row-reverse">
|
||||||
|
<Avatar
|
||||||
|
v-if="remainingGroupSize > 0"
|
||||||
|
:size="size"
|
||||||
|
:text="`+${remainingGroupSize}`"
|
||||||
|
:class="avatarClass"
|
||||||
|
/>
|
||||||
<Avatar
|
<Avatar
|
||||||
v-for="(avatar, index) of displayedGroup"
|
v-for="(avatar, index) of displayedGroup"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -7,12 +13,6 @@
|
|||||||
:size="size"
|
:size="size"
|
||||||
:class="avatarClass"
|
:class="avatarClass"
|
||||||
/>
|
/>
|
||||||
<Avatar
|
|
||||||
v-if="remainingGroupSize > 0"
|
|
||||||
:size="size"
|
|
||||||
:text="`+${remainingGroupSize}`"
|
|
||||||
:class="avatarClass"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -55,9 +55,9 @@ const avatars = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const displayedGroup = 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(() => {
|
const remainingGroupSize = computed(() => {
|
||||||
|
|||||||
@@ -383,7 +383,7 @@ export default (variantColors: string[]) => {
|
|||||||
|
|
||||||
const avatarGroup = {
|
const avatarGroup = {
|
||||||
ring: 'ring-2 u-ring-white',
|
ring: 'ring-2 u-ring-white',
|
||||||
margin: '-ml-1.5 first:ml-0'
|
margin: '-mr-1.5 first:mr-0'
|
||||||
}
|
}
|
||||||
|
|
||||||
const slideover = {
|
const slideover = {
|
||||||
|
|||||||
Reference in New Issue
Block a user