VuetifyDialogLoader
Vuetify Dialog Loader Component (with SnackBar) component that can be used locally or globally
This component use the Vuetify Dialog Loader to show loading dialog, with optional SnackBar notifications (snackbar disabled by default)
Usage
Insert component where you want to use it:
Alternatively you can place it in main App component and access it globally via this.$root.$confirm
Standard Usage Without Callback:
snackbar will hide after timeout value:
only necessary if timeout is set to 0 or need to hide snackbar for some other reason:
Advanced Usage (with optional callback that returns a promise)
Start Action Loader
- Argument 3 (callback) should be a function that returns a Promise (optional)
- Argument 4 (snackbar) can be a boolean (true/false) or object (snackbar options) to enable showing snackbar when promise is resolved/rejected (optional)
Example:
Stop Action Loader (and Show Snackbar)
Example:
Combined with Confirm Dialog
This can be combined with eolant's Vuetify Confirm Dialog (https://gist.github.com/eolant/ba0f8a5c9135d1a146e1db575276177d) component to create a dialog along with loader and snackbar.
Example:
this.removeClientPromiseFn
is a function that returns a promise after performing db actions
Another example just as a demo using setTimeout
: