From 564825f3a8337ae6dbb886208f05f79727ad2e93 Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Sat, 3 Jun 2023 06:59:17 +0300 Subject: [PATCH] fix click on file --- app.vue | 2 +- components/tree-view.vue | 31 +++++++++++++++---------------- composables/files-manager.ts | 4 ++-- 3 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app.vue b/app.vue index ceed2cf..585b989 100644 --- a/app.vue +++ b/app.vue @@ -54,7 +54,7 @@ onUnmounted(() => { watchEffect(() => { const file = filesManager.getFile(selectedPath.value); - filesGridList.value = file?.isFolder ? file.content : []; + filesGridList.value = file?.content; selectedList.value = []; for (const selectedElement of document.querySelectorAll(".selectable.selected")) { diff --git a/components/tree-view.vue b/components/tree-view.vue index 7d3ca22..5fe11c5 100644 --- a/components/tree-view.vue +++ b/components/tree-view.vue @@ -2,35 +2,34 @@ import { CompressedFile } from 'libarchive.js/src/compressed-file'; interface Props { - filesList: (File | CompressedFile) & { name: string, path: string, toggle: Boolean, isFolder: Boolean, content: any, active: boolean } [], + filesList: (File | CompressedFile) & { name: string, path: string, toggle: Boolean, isFolder: Boolean, content: any, active: boolean }[], nav: boolean } -let {filesList, nav} = defineProps() +let { filesList, nav } = defineProps() let selectedPath = useSelectedPath();