api.exec()
Description
Allows triggering the File Manager actionsUsage
api.exec(
action: string,
config: object
): void;
Parameters
action
- (required) an action to be firedconfig
- (required) the config object with parameters (see the action to be fired)
Actions
info
The full list of the File Manager actions can be found here
Example
In the example below we clear the filter when the Preview panel is closed or opened.
<script>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "wx-svelte-filemanager";
let api;
function clearSearch() {
api.exec("filter-files", {
text: "",
});
}
</script>
<Filemanager
data={getData()}
drive={getDrive()}
bind:api
on:show-preview={clearSearch} />
Related articles: