From a0e066c04f6f7265e80d1cdbfe4c31c7fbd4ad20 Mon Sep 17 00:00:00 2001 From: hi2hi Date: Sun, 20 Apr 2025 15:35:26 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E6=B7=BB=E5=8A=A0=E7=A6=BB?= =?UTF-8?q?=E7=BA=BF=E6=95=B0=E9=87=8F=E4=B8=BA0=E6=97=B6=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E6=B8=85=E7=A9=BA=E5=9C=A8=E7=BA=BF=E7=AD=9B=E9=80=89?= =?UTF-8?q?=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/home.vue | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/views/home.vue b/src/views/home.vue index 8d1b3f7..491125b 100644 --- a/src/views/home.vue +++ b/src/views/home.vue @@ -89,6 +89,7 @@ import { onActivated, onDeactivated, nextTick, + watch, } from 'vue'; import { useStore, @@ -200,6 +201,20 @@ const onlineOptions = computed(() => { return []; }); +/** + * 筛选离线时,离线数量变为0时,自动清空在线筛选 + */ +watch(() => serverCount.value, () => { + if (filterFormData.value.online === '-1' && serverCount.value.offline === 0) { + filterFormData.value.online = ''; + } + if (filterFormData.value.online === '1' && serverCount.value.online === 0) { + filterFormData.value.online = ''; + } +}, { + immediate: true, +}); + const listTypeOptions = computed(() => [{ key: 'card', label: '卡片',