Skip to main content

set-path

Description

Fires when a path is changed

Usage

"set-path": ({
id: string,
selected?: string [],
panel?: 0|1,
}) => boolean | void;

Parameters

The callback of the set-path action takes an object with the following parameters:

  • id - (required) the ID of a new directory
  • selected - (optional) an array of files ids selected in a new directory
  • panel - (optional) the panel number where an item is selected (0|1); by default, the active panel number is set to 0

Example

<script setup>
import { getData, getDrive } from "./common/data";
import { Filemanager } from "@svar-ui/vue-filemanager";

function init(api) {
api.on("set-path", ({ id }) => {
console.log(`The path changed to: ${id}`);
});
}
</script>

<template>
<Filemanager :data="getData()" :drive="getDrive()" :init="init" />
</template>

Related articles: How to access File Manager API