From 2f40b4f03b9b87e463a1b726e69cc187077f0794 Mon Sep 17 00:00:00 2001 From: Miao_Spring <539943419@qq.com> Date: Sun, 11 Aug 2024 22:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=88=A0=E9=99=A4=E5=92=8C?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=96=87=E4=BB=B6=E6=93=8D=E4=BD=9C=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E7=9A=84api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 24 ++++- src/class/UploadQueue.ts | 6 +- .../miaoDirectory/miaoDirectoryItem.vue | 13 ++- src/config.ts | 4 +- src/hooks/useMiaoFetchApi.ts | 88 +++++++++++++++---- src/types/fetch.ts | 5 ++ src/views/miaoDirectory.vue | 48 +++++++--- vite.config.ts | 13 ++- 8 files changed, 159 insertions(+), 42 deletions(-) diff --git a/src/App.vue b/src/App.vue index 89eb32f..22e43c4 100644 --- a/src/App.vue +++ b/src/App.vue @@ -42,6 +42,23 @@ const deleteView = (index: number) => { } } +// 若存在两个以上标签页可见则除点击的标签页以外其他全部隐藏,若只有一个标签页可见则全部展示 +// 这个逻辑以后再研究吧,平时感觉用不到 +const handleClickTitle = (index: number) => { + let count = views.filter(v=>v.visible).length + let _index = 0 + while(_index < views.length) { + if(_index !== index) { + views[_index].visible = count > 1 ? false : true + }else { + views[_index].visible = true + } + _index += 1 + } +} + + +// 顶部菜单相关 function renderIcon(icon: any) { return () => { return h(NIcon, null, { @@ -66,7 +83,7 @@ const handleMenuSelect = (key: string) => { component: NQrCode, props: { value: baseUrl, - size: 500, + size: 300, errorCorrectionLevel: 'H' } } @@ -76,8 +93,6 @@ const handleMenuSelect = (key: string) => { onMounted(() => { createView(rootDirectory) }) - -// todo: 让所有伪页面共享一个rootDirectory