feat: isFetching

This commit is contained in:
yangsy
2025-08-26 14:04:28 +08:00
parent a75c8edacc
commit 0c1d1b2886
2 changed files with 32 additions and 3 deletions

View File

@@ -34,7 +34,20 @@ import { h, onMounted, useTemplateRef } from 'vue';
import { computed, ref, watch } from 'vue';
import { useRoute, useRouter, type LocationQuery } from 'vue-router';
useLineDevicesQuery();
const { isFetching: lineDevicesFetching } = useLineDevicesQuery();
watch(
lineDevicesFetching,
(fetching) => {
if (fetching) {
window.$loadingBar.start();
} else {
window.$loadingBar.finish();
}
},
{
immediate: true,
},
);
const route = useRoute();
const router = useRouter();