From b16fd1ac15d2c20dd6096de06ae6e65d56d2fe7b Mon Sep 17 00:00:00 2001 From: hi2hi Date: Tue, 1 Apr 2025 11:36:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E5=88=86=E7=BB=84=E4=B8=8B=E4=B8=8D=E5=AD=98=E5=9C=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E6=97=B6=EF=BC=8Cservers=E5=AF=B9=E8=B1=A1?= =?UTF-8?q?=E4=B8=8D=E5=AD=98=E5=9C=A8=E5=AF=BC=E8=87=B4=E5=88=86=E7=BB=84?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home.vue | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/views/home.vue b/src/views/home.vue index 42eae47..6e3e6be 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -20,9 +20,9 @@ >
@@ -158,13 +158,21 @@ const showTag = computed(() => { const serverList = computed(() => store.state.serverList); // 服务器总数 const serverCount = computed(() => store.state.serverCount); - -const tagOptions = computed(() => store.state.serverGroup.map((i) => ({ - key: uuid(), - label: i.name, - value: i.name, - title: `${i.servers.length}台`, -}))); +// 分组标签 +const serverGroupOptions = computed(() => { + const options = []; + store.state.serverGroup.forEach((i) => { + if (i.servers && i.servers.length > 0) { + options.push({ + key: uuid(), + label: i.name, + value: i.name, + title: `${i.servers.length}台`, + }); + } + }); + return options; +}); const onlineOptions = computed(() => { if (serverCount.value?.total !== serverCount.value?.online) {