✨ new maps
This commit is contained in:
@@ -49,16 +49,20 @@ const props = defineProps<{
|
||||
}>();
|
||||
|
||||
async function toggleCollapse() {
|
||||
if (isCollapsed) {
|
||||
const isOpening = isCollapsed.value;
|
||||
isCollapsed.value = !isCollapsed.value;
|
||||
if (isOpening) {
|
||||
await fetchDirectoryContent();
|
||||
}
|
||||
isCollapsed.value = !isCollapsed.value;
|
||||
}
|
||||
|
||||
async function fetchDirectoryContent() {
|
||||
try {
|
||||
isLoading.value = true;
|
||||
content.value = await fs.listDir(props.dir);
|
||||
// preload from cache
|
||||
content.value = await fs.listDir(props.dir, {cache: 'only-cache'});
|
||||
// replace with network
|
||||
content.value = await fs.listDir(props.dir, {cache: 'use-network'});
|
||||
} finally {
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user