Disable LoadingBar plugin for certain Ajax calls
-
Hi all,
I´m using the LoadingBar plugin but would like to disable it for certain Ajax calls. E.g. I´m polling some status from the backend server every few seconds and displaying a loading bar for every poll request doesnt make sense.
Whats the recommended approach here?
Thanks!
-
@perelin I have a mixin that I include on certain pages that I want to hide the loading bar:
export default { created() { this.loadingBarSize = this.$q.loadingBar.size this.$q.loadingBar.setDefaults({ size: '0px' }) }, destroyed() { this.$q.loadingBar.setDefaults({ size: this.loadingBarSize }) }, }
This disables all loading bars on a certain page, but you could just do something like:
methods: { async makeAjaxCall() { const loadingBarSize = this.$q.loadingBar.size this.$q.loadingBar.setDefaults({ size: '0px' }) // await some axios call this.$q.loadingBar.setDefaults({ size: loadingBarSize }) }, }
-
Will give it a try, thx!