forked from mirrors/homebox
feat: expanded search for items (#46)
* expanded search for items * range domain from email to example * implement pagination for items
This commit is contained in:
parent
1b20a69c5e
commit
30014a77ca
31 changed files with 751 additions and 346 deletions
32
frontend/composables/use-min-loader.ts
Normal file
32
frontend/composables/use-min-loader.ts
Normal file
|
@ -0,0 +1,32 @@
|
|||
import { WritableComputedRef } from "vue";
|
||||
|
||||
export function useMinLoader(ms = 500): WritableComputedRef<boolean> {
|
||||
const loading = ref(false);
|
||||
|
||||
const locked = ref(false);
|
||||
|
||||
const minLoading = computed({
|
||||
get: () => loading.value,
|
||||
set: value => {
|
||||
if (value) {
|
||||
loading.value = true;
|
||||
|
||||
if (!locked.value) {
|
||||
locked.value = true;
|
||||
setTimeout(() => {
|
||||
locked.value = false;
|
||||
}, ms);
|
||||
}
|
||||
}
|
||||
|
||||
if (!value && !locked.value) {
|
||||
loading.value = false;
|
||||
} else if (!value && locked.value) {
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, ms);
|
||||
}
|
||||
},
|
||||
});
|
||||
return minLoading;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue