Ajax Bar is a component which displays a loading bar (like Youtube) whenever an Ajax call (regardless of Ajax library used) is in progress. It can be manually triggered as well.
As long as this component is rendered by Vue it will capture all Ajax calls.
Best way is to place it in your App root component (
App.vue if you are using the default Quasar template):
Do not simultaneously use more than one Ajax Bar component in your App.
|Vue Property||Type||Default Value||Description|
|String||‘top’||Where to place the loading bar: ‘top’, ‘bottom’, ‘left’ or ‘right’.|
|String||‘4px’||Thickness of loading bar.|
|String||‘#e21b0c’||CSS color of loading bar.|
|Number||250||How fast should loading bar update its value (in milliseconds).|
|Number||1000||How much should loading bar wait before showing loading bar after it’s triggered (in milliseconds).|
|Boolean||Reverse direction of loading bar.|
Only if you want to also trigger it manually. Ajax calls trigger these methods automatically.
|Trigger loading bar.|
|Notify one event has finished.|
|Triggered when loading bar has been triggered to be displayed.|
|Triggered when loading bar finished its work and goes hidden.|
If multiple events are captured by Ajax Bar simultaneously,
@stopwill still be triggered only once: when loading bar starts showing up and when it goes hidden.
Each Ajax call makes a
start() call when it is triggered. When it ends, it calls
stop(). So yes, if you also manually trigger Ajax Bar you must call
start() each time a new event is starting and
stop() each time an event finished. Ajax Bar knows to handle multiple events simultaneously.