simplify sort on FileNavigator

This commit is contained in:
stkevintan
2025-12-06 00:00:29 +08:00
parent feb62196a2
commit e98836fd0e
2 changed files with 3 additions and 11 deletions

View File

@@ -283,9 +283,6 @@ onMounted(async () => {
await loadRootDirectories()
})
onActivated(() => {
// updateHeight()
})
</script>
<template>

View File

@@ -41,15 +41,10 @@ const newFolderPopper = ref(false)
// 新建文件名称
const newFolderName = ref('')
// 排序方式
const sort = ref(inProps.sort)
// 调整排序方式
function changeSort() {
if (sort.value === 'name') sort.value = 'time'
else sort.value = 'name'
emit('sortchanged', sort.value)
const newSort = inProps.sort === 'name' ? 'time' : 'name'
emit('sortchanged', newSort)
}
// 计算PATH面包屑
@@ -116,7 +111,7 @@ async function mkdir() {
// 计算排序图标
const sortIcon = computed(() => {
if (sort.value === 'time') return 'mdi-sort-clock-ascending-outline'
if (inProps.sort === 'time') return 'mdi-sort-clock-ascending-outline'
else return 'mdi-sort-alphabetical-ascending'
})
</script>