2021-01-30 03:16:17 +00:00
|
|
|
import { watch, WatchSource } from 'vue';
|
2020-11-15 13:18:28 +00:00
|
|
|
import { LoadingBar } from 'quasar';
|
|
|
|
|
|
|
|
function setLoadingBar(loading: WatchSource<boolean>) {
|
2021-03-18 16:23:57 +00:00
|
|
|
return watch<boolean>(loading, (loading) => {
|
2020-11-15 13:18:28 +00:00
|
|
|
if (loading) LoadingBar.start(10000);
|
|
|
|
if (!loading) LoadingBar.stop();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export default setLoadingBar;
|