1import i18n from '../../i18n'; 2 3const BVToastMixin = { 4 methods: { 5 successToast(message, title = i18n.t('global.status.success')) { 6 this.$root.$bvToast.toast(message, { 7 title, 8 variant: 'success', 9 autoHideDelay: 10000, //auto hide in milliseconds 10 isStatus: true, 11 solid: true 12 }); 13 }, 14 errorToast(message, title = i18n.t('global.status.error')) { 15 this.$root.$bvToast.toast(message, { 16 title, 17 variant: 'danger', 18 noAutoHide: true, 19 isStatus: true, 20 solid: true 21 }); 22 }, 23 warningToast(message, title = i18n.t('global.status.warning')) { 24 this.$root.$bvToast.toast(message, { 25 title, 26 variant: 'warning', 27 noAutoHide: true, 28 isStatus: true, 29 solid: true 30 }); 31 }, 32 infoToast(message, title = i18n.t('global.status.informational')) { 33 this.$root.$bvToast.toast(message, { 34 title, 35 variant: 'info', 36 noAutoHide: true, 37 isStatus: true, 38 solid: true 39 }); 40 } 41 } 42}; 43 44export default BVToastMixin; 45