mirror of
https://github.com/hi2shark/nazhua.git
synced 2026-01-14 08:10:42 +08:00
✨ 添加离线数量为0时自动清空在线筛选的功能
This commit is contained in:
parent
513a88d37e
commit
a0e066c04f
@ -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: '卡片',
|
||||
|
||||
Loading…
Reference in New Issue
Block a user