show-preview
Description
Fires when the visibility of the Preview panel changesUsage
"show-preview": ({
mode: boolean
})
Parameters
The callback of the show-preview action takes an object with the following parameters:
mode
- it's set to false to hide the file preview panel (default); set to true, to show the preview
Example
<script>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "wx-svelte-filemanager";
let api;
$: if (api) {
api.on("show-preview", ({ mode }) => {
console.log(`Preview is ${mode ? "visible" : "hidden"}`);
});
}
</script>
<Filemanager data={getData()} drive={getDrive()} bind:api />
Related articles: How to access File Manager API