mirror of
https://github.com/alrayyes/wiki.git
synced 2025-05-28 18:09:01 +00:00
feat(explorer): integrate filter option
This commit is contained in:
parent
036a33f70b
commit
31d16fbd2c
2 changed files with 10 additions and 0 deletions
quartz/components
|
@ -35,6 +35,11 @@ export default ((userOpts?: Partial<Options>) => {
|
|||
// Sort tree (folders first, then files (alphabetic))
|
||||
fileTree.sort(opts.sortFn!)
|
||||
|
||||
// If provided, apply filter function to fileTree
|
||||
if (opts.filterFn) {
|
||||
fileTree.filter(opts.filterFn)
|
||||
}
|
||||
|
||||
// Get all folders of tree. Initialize with collapsed state
|
||||
const folders = fileTree.getFolderPaths(opts.folderDefaultState === "collapsed")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue