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
@@ -283,9 +283,6 @@ onMounted(async () => {
await loadRootDirectories() await loadRootDirectories()
}) })
onActivated(() => {
// updateHeight()
})
</script> </script>
<template> <template>
+3 -8
View File
@@ -41,15 +41,10 @@ const newFolderPopper = ref(false)
// 新建文件名称 // 新建文件名称
const newFolderName = ref('') const newFolderName = ref('')
// 排序方式
const sort = ref(inProps.sort)
// 调整排序方式 // 调整排序方式
function changeSort() { function changeSort() {
if (sort.value === 'name') sort.value = 'time' const newSort = inProps.sort === 'name' ? 'time' : 'name'
else sort.value = 'name' emit('sortchanged', newSort)
emit('sortchanged', sort.value)
} }
// 计算PATH面包屑 // 计算PATH面包屑
@@ -116,7 +111,7 @@ async function mkdir() {
// 计算排序图标 // 计算排序图标
const sortIcon = computed(() => { 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' else return 'mdi-sort-alphabetical-ascending'
}) })
</script> </script>