|
|
@ -18,7 +18,7 @@ export function useLoadingIndicator({ duration = 2000, throttle = 200 }: UseLoad |
|
|
|
progress.value = 0 |
|
|
|
progress.value = 0 |
|
|
|
isLoading.value = true |
|
|
|
isLoading.value = true |
|
|
|
if (throttle) { |
|
|
|
if (throttle) { |
|
|
|
if (process.client) { |
|
|
|
if (import.meta.client) { |
|
|
|
_throttle = setTimeout(_startTimer, throttle) |
|
|
|
_throttle = setTimeout(_startTimer, throttle) |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
@ -44,7 +44,7 @@ export function useLoadingIndicator({ duration = 2000, throttle = 200 }: UseLoad |
|
|
|
|
|
|
|
|
|
|
|
function _hide() { |
|
|
|
function _hide() { |
|
|
|
clear() |
|
|
|
clear() |
|
|
|
if (process.client) { |
|
|
|
if (import.meta.client) { |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
|
isLoading.value = false |
|
|
|
isLoading.value = false |
|
|
|
setTimeout(() => { |
|
|
|
setTimeout(() => { |
|
|
@ -55,7 +55,7 @@ export function useLoadingIndicator({ duration = 2000, throttle = 200 }: UseLoad |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function _startTimer() { |
|
|
|
function _startTimer() { |
|
|
|
if (process.client) { |
|
|
|
if (import.meta.client) { |
|
|
|
_timer = setInterval(() => { |
|
|
|
_timer = setInterval(() => { |
|
|
|
_increase(step.value) |
|
|
|
_increase(step.value) |
|
|
|
}, 100) |
|
|
|
}, 100) |
|
|
|