diff options
Diffstat (limited to 'src/components/Mixins/BVToastMixin.js')
-rw-r--r-- | src/components/Mixins/BVToastMixin.js | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/components/Mixins/BVToastMixin.js b/src/components/Mixins/BVToastMixin.js index 489173c9..a46f5e50 100644 --- a/src/components/Mixins/BVToastMixin.js +++ b/src/components/Mixins/BVToastMixin.js @@ -1,22 +1,33 @@ +import i18n from '../../i18n'; + const BVToastMixin = { methods: { - successToast(message) { + successToast(message, title = i18n.t('global.response.success')) { this.$root.$bvToast.toast(message, { - title: 'Success', + title, variant: 'success', autoHideDelay: 10000, //auto hide in milliseconds isStatus: true, solid: true }); }, - errorToast(message) { + errorToast(message, title = i18n.t('global.response.error')) { this.$root.$bvToast.toast(message, { - title: 'Error', + title, variant: 'danger', noAutoHide: true, isStatus: true, solid: true }); + }, + warningToast(message, title = i18n.t('global.response.warning')) { + this.$root.$bvToast.toast(message, { + title, + variant: 'warning', + noAutoHide: true, + isStatus: true, + solid: true + }); } } }; |