Feature(custom): add sort type indicate #374

This commit is contained in:
Kuingsmile
2025-08-20 15:48:27 +08:00
parent fbf0dcc691
commit 6b45632ede
4 changed files with 46 additions and 34 deletions

View File

@@ -204,7 +204,7 @@
<div class="dropdown">
<button class="dropdown-button" @click="sortDropdownOpen = !sortDropdownOpen">
<ArrowUpDownIcon class="action-icon" />
{{ t('pages.manage.bucket.sort.title') }}
{{ t(`pages.manage.bucket.sort.${currentSortType}`) }}
<ChevronDownIcon class="action-icon" />
</button>
<div v-if="sortDropdownOpen" class="dropdown-content">
@@ -1236,6 +1236,7 @@ const linkFormatList = ['url', 'markdown', 'markdown-with-link', 'html', 'bbcode
type ISortTypeList = 'name' | 'size' | 'time' | 'ext' | 'check' | 'init'
const sortTypeList = ['name', 'size', 'time', 'ext', 'check', 'init']
const currentSortType = ref<ISortTypeList>('name')
// 路由相关
const route = useRoute()
@@ -2065,6 +2066,7 @@ const handlePageNumberInput = (event: Event) => {
}
function sortFile(type: 'name' | 'size' | 'time' | 'ext' | 'check' | 'init') {
currentSortType.value = type
switch (type) {
case 'name':
localStorage.setItem('sortType', 'name')

View File

@@ -198,8 +198,8 @@
}
.action-icon {
width: 18px;
height: 18px;
width: 16px;
height: 16px;
}
.search-input {