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