From 81e5d9d9667fb58b45b9d09634ebce0f9eccfa8f Mon Sep 17 00:00:00 2001 From: Salem Yaslem Date: Fri, 19 May 2023 18:09:48 +0300 Subject: [PATCH] add loading indicator --- app.vue | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/app.vue b/app.vue index 0b86d50..2277829 100644 --- a/app.vue +++ b/app.vue @@ -11,18 +11,21 @@ Archive.init({ let display = useDisplay(); let drawer = ref(!display.xs.value); +let loadingModel = ref(false); let files = ref([]); let filesList = ref([]); let selectedItem = useSelectedItem(); +let filesGridList = ref([]) +let selectedList = ref([]) watchEffect(async () => { if (files.value?.[0]) { + loadingModel.value = true; filesList.value = []; const archive = await Archive.open(files.value[0]); - // console.log(await archive.getFilesObject()) let extractedFiles = await archive.getFilesObject(); let getContent = (fileList: any, path = ''): any => { @@ -39,6 +42,7 @@ watchEffect(async () => { filesList.value = getContent(extractedFiles)?.sort((a: any, b: any) => { return b.isFolder - a.isFolder }); + loadingModel.value = false; } }) @@ -89,9 +93,6 @@ function getFile(path: string, innerList = undefined): any { return undefined; } -let filesGridList = ref([]) -let selectedList = ref([]) - watchEffect(() => { filesGridList.value = getFile(selectedItem.value)?.content || []; selectedList.value = []; @@ -194,6 +195,22 @@ function onSelectEnd(e: any) { + + + + Please stand by + + + +