mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-06 20:42:57 +08:00
✨ Feature(custom): show selected image number in gallery page
This commit is contained in:
@@ -9,7 +9,8 @@
|
||||
</div>
|
||||
<div>
|
||||
<h1>{{ t('pages.gallery.title') }}</h1>
|
||||
<p>{{ filterList.length }} {{ t('pages.gallery.images') }}</p>
|
||||
<p v-if="selectedCount > 0">{{ `${selectedCount}/${filterList.length} ${t('pages.gallery.selected')}` }}</p>
|
||||
<p v-else>{{ `${filterList.length} ${t('pages.gallery.images')}` }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-actions">
|
||||
@@ -178,7 +179,7 @@
|
||||
</button>
|
||||
<button class="action-btn delete-btn" :class="{ active: isMultiple(choosedList) }" @click="multiRemove">
|
||||
<TrashIcon :size="16" />
|
||||
{{ t('pages.gallery.delete') }}
|
||||
{{ `${t('pages.gallery.delete')}${selectedCount > 0 ? ` (${selectedCount})` : ''}` }}
|
||||
</button>
|
||||
<button class="action-btn select-btn" :class="{ active: filterList.length > 0 }" @click="toggleSelectAll">
|
||||
<CheckSquareIcon :size="16" />
|
||||
@@ -693,6 +694,10 @@ const isAllSelected = computed(() => {
|
||||
return Object.values(choosedList).length > 0 && filterList.value.every(item => choosedList[item.id!])
|
||||
})
|
||||
|
||||
const selectedCount = computed(() => {
|
||||
return Object.values(choosedList).filter(v => v).length
|
||||
})
|
||||
|
||||
const currentPreviewImage = computed(() => {
|
||||
const item = filterList.value[gallerySliderControl.index]
|
||||
if (!item) return null
|
||||
|
||||
Reference in New Issue
Block a user