12 lines
317 B
TypeScript
12 lines
317 B
TypeScript
|
import { watch, WatchSource } from '@vue/composition-api';
|
||
|
import { LoadingBar } from 'quasar';
|
||
|
|
||
|
function setLoadingBar(loading: WatchSource<boolean>) {
|
||
|
return watch<boolean>(loading, loading => {
|
||
|
if (loading) LoadingBar.start(10000);
|
||
|
if (!loading) LoadingBar.stop();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
export default setLoadingBar;
|