new maps

This commit is contained in:
2024-11-24 17:34:41 +00:00
parent eb6abbb97d
commit 641938f7e4
38 changed files with 1241 additions and 228 deletions

View File

@@ -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;
}