Skip to main content

api.exec()

Description​

Allows triggering the File Manager actions

Usage​

api.exec(
action: string,
config: object
): void;

Parameters​

  • action - (required) an action to be fired
  • config - (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 setup>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@svar-ui/vue-filemanager";
import { ref } from "vue";

const api = ref(null);

function clearSearch() {
api.value.exec("filter-files", {
text: "",
});
}
</script>

<template>
<Filemanager
:data="getData()"
:drive="getDrive()"
ref="api"
:onshowpreview="clearSearch" />
</template>

Related articles: