open-file
Description
Fires when opening a fileThe action is triggered with a double-click on a file but you need to add the event handler to process the action (e.g., use the api.on() method) so that a file gets opened.
Usage
"open-file": ({
id: string
}) => boolean | void;
Parameters
The callback of the open-file action takes an object with the following parameters:
id- (required) the ID of a file
Example
<script setup>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@svar-ui/vue-filemanager";
function init(api) {
api.on("open-file", ({ id }) => {
console.log(`File ${id} is double-clicked`);
});
}
</script>
<template>
<Filemanager :data="getData()" :drive="getDrive()" :init="init" />
</template>
Related articles: How to access File Manager API