Comments (4)
從 API 的層面上是可以做到多級排序的,問題還是在於 UI 上。比如這種 UI 就非常複雜了
在前端畫這種複雜的 UI 對我來説太難了,而且還要考慮移動端適配問題的話就更複雜了。如果有大佬幫忙畫的話我倒是很樂意實現相應功能。
目前來説可能對你最有意義的是直接加入你自己想要的排序方式:
Lines 97 to 98 in 70d6926
from gdir.
其实主要的需求是在现有的排序功能基础上,能够默认使文件夹优先显示就好了,现在默认是文件和文件夹混排的,不太符合大多数本地文件管理器的使用习惯 🙈
from gdir.
這可不一定,我個人的習慣就不是文件夾優先的,而是更改時間優先,或者文件名優先。如果使用任何假設的習慣來設計,可能以後會有別人開個 issue 說自己有不一樣的習慣,這樣很難處理的。
所以我覺得如果有特殊的多級排序需求,自己在代碼中添加一個排序選項就是了,複製粘貼的事情,並不難改。比如你想要按 文件夾-時間 的層級排序,可以添加這樣的排序選項:
folder_modifiedTime: {
name: 'Folders - Modified Time',
field: 'folder_modifiedTime',
defaultDescending: false,
ascendingIcon: 'fa-sort-down',
descendingIcon: 'fa-sort-sort-up',
ascendingQuery: 'folder,modifiedTime',
descendingQuery: 'folder,modifiedTime desc',
},
from gdir.
這可不一定,我個人的習慣就不是文件夾優先的,而是更改時間優先,或者文件名優先。如果使用任何假設的習慣來設計,可能以後會有別人開個 issue 說自己有不一樣的習慣,這樣很難處理的。
所以我覺得如果有特殊的多級排序需求,自己在代碼中添加一個排序選項就是了,複製粘貼的事情,並不難改。比如你想要按 文件夾-時間 的層級排序,可以添加這樣的排序選項:
folder_modifiedTime: { name: 'Folders - Modified Time', field: 'folder_modifiedTime', defaultDescending: false, ascendingIcon: 'fa-sort-down', descendingIcon: 'fa-sort-sort-up', ascendingQuery: 'folder,modifiedTime', descendingQuery: 'folder,modifiedTime desc', },
okk,因为个人接触过的比如 Windows 的资源管理器和 Manjaro KDE 自带的 Dolphin 默认排序都是文件夹在前的,乍一看混排的有点不习惯,感谢作者提醒。
from gdir.
Related Issues (9)
- Failed to run setup HOT 12
- 写了个教程,希望能帮到大家 HOT 1
- gist 无法使用用户名密码方式鉴权 HOT 1
- 看不到文件具体大小有点点不便
- go: errors parsing go.mod: HOT 1
- gdir 安装出错 HOT 1
- issues
- 几个不成熟的小建议
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gdir.