mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 15:36:49 +08:00
simplify sort on FileNavigator
This commit is contained in:
@@ -283,9 +283,6 @@ onMounted(async () => {
|
|||||||
await loadRootDirectories()
|
await loadRootDirectories()
|
||||||
})
|
})
|
||||||
|
|
||||||
onActivated(() => {
|
|
||||||
// updateHeight()
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user