Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 1 | const LoadingBarMixin = { |
Mateusz Gapski | 471f2e0 | 2020-07-27 14:43:26 +0200 | [diff] [blame] | 2 | data() { |
| 3 | return { |
| 4 | loading: true |
| 5 | }; |
| 6 | }, |
Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 7 | methods: { |
| 8 | startLoader() { |
| 9 | this.$root.$emit('loader::start'); |
Mateusz Gapski | 471f2e0 | 2020-07-27 14:43:26 +0200 | [diff] [blame] | 10 | this.loading = true; |
Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 11 | }, |
| 12 | endLoader() { |
| 13 | this.$root.$emit('loader::end'); |
Mateusz Gapski | 471f2e0 | 2020-07-27 14:43:26 +0200 | [diff] [blame] | 14 | this.loading = false; |
Yoshie Muranaka | 3be801a | 2020-04-21 11:34:56 -0700 | [diff] [blame] | 15 | }, |
| 16 | hideLoader() { |
| 17 | this.$root.$emit('loader::hide'); |
| 18 | } |
| 19 | } |
| 20 | }; |
| 21 | |
| 22 | export default LoadingBarMixin; |