Yoshie Muranaka | 183c275 | 2020-02-12 11:30:49 -0800 | [diff] [blame^] | 1 | import i18n from '../../i18n'; |
| 2 | |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 3 | const BVToastMixin = { |
| 4 | methods: { |
Yoshie Muranaka | 183c275 | 2020-02-12 11:30:49 -0800 | [diff] [blame^] | 5 | successToast(message, title = i18n.t('global.response.success')) { |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 6 | this.$root.$bvToast.toast(message, { |
Yoshie Muranaka | 183c275 | 2020-02-12 11:30:49 -0800 | [diff] [blame^] | 7 | title, |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 8 | variant: 'success', |
| 9 | autoHideDelay: 10000, //auto hide in milliseconds |
| 10 | isStatus: true, |
| 11 | solid: true |
| 12 | }); |
| 13 | }, |
Yoshie Muranaka | 183c275 | 2020-02-12 11:30:49 -0800 | [diff] [blame^] | 14 | errorToast(message, title = i18n.t('global.response.error')) { |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 15 | this.$root.$bvToast.toast(message, { |
Yoshie Muranaka | 183c275 | 2020-02-12 11:30:49 -0800 | [diff] [blame^] | 16 | title, |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 17 | variant: 'danger', |
| 18 | noAutoHide: true, |
| 19 | isStatus: true, |
| 20 | solid: true |
| 21 | }); |
Yoshie Muranaka | 183c275 | 2020-02-12 11:30:49 -0800 | [diff] [blame^] | 22 | }, |
| 23 | warningToast(message, title = i18n.t('global.response.warning')) { |
| 24 | this.$root.$bvToast.toast(message, { |
| 25 | title, |
| 26 | variant: 'warning', |
| 27 | noAutoHide: true, |
| 28 | isStatus: true, |
| 29 | solid: true |
| 30 | }); |
Yoshie Muranaka | 0fc91e7 | 2020-02-05 11:23:06 -0800 | [diff] [blame] | 31 | } |
| 32 | } |
| 33 | }; |
| 34 | |
| 35 | export default BVToastMixin; |