Skip to main content

sort-files

Description

Fires when sorting files

Usage

"sort-files": ({
key: string,
order: "asc" | "desc",
panel?: 0 | 1,
path?: string
}) => boolean | void;

Parameters

The callback of the sort-files action takes an object with the following parameters:

  • key - (required) specifies the field to sort by
  • order- (required) specifies the direction to sort by: "asc" | "desc"
  • panel - (optional) defines the panel where the action takes place (0 (left) | 1 (right))
  • path - (optional) the ID of a folder where files are sorted

Example

<script setup>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@svar-ui/vue-filemanager";

function init(api){
api.exec("sort-files", {
key: "name",
order: "desc",
});
}
</script>

<template>
<Filemanager
:data="getData()"
:drive="getDrive()"
:init="init" />
</template>

Related articles: How to access File Manager API