move-files
Description
Fires when moving a file or folder (cutting and pasting it)Usage
"move-files": ({
ids: string [],
target: string,
newIds?: string []
}) => boolean | void;
Parameters
The callback of the move-files action takes an object with the following parameters:
ids
- (required) an array of files IDs that are movedtarget
- (required) the ID of the location where a file or folder is movednewIds
- (optional) new generated Ids of files after being moved (the readonly parameter, it's not recommended to set this parameter manually when calling actions)
Example
<script>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "wx-svelte-filemanager";
let api;
$: if (api) {
api.on("move-files", ({ ids, target }) =>
console.log(`${ids.join(", ")} moved to ${target}`));
}
</script>
<Filemanager data={getData()} drive={getDrive()} bind:api />
Related articles: How to access File Manager API