delete-files
Description
Fires when deleting a file or folderUsage
"delete-files": ({ ids: [] })
Parameters
The callback of the delete-files action takes an object with the following parameters:
ids
- (required) an array with IDs of files or folders that are deleted
Returning false from the event handler will block the operation, which you can do via the api.intercept()
method.
Example
<script>
import { Filemanager } from "wx-svelte-filemanager";
import { getData, getDrive } from "./common/data";
let api;
$: if (api) {
api.on("delete-files", ({ ids }) => {
console.log(`${ids.join(", ")} were deleted`);
});
}
</script>
<Filemanager
bind:api
data={getData()}
drive={getDrive()}
//other settings />
Related articles: How to access File Manager API