1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <template lang="pug">
- modal(name="pos-loader" transition="nice-modal-fade" @before-close="beforeClose")
- h2 Cargando
- </template>
- <script>
- import { mapGetters, mapActions } from 'vuex'
- export default {
- computed: mapGetters({
- loaded: 'isLoaded'
- }),
- watch: {
- loaded(completed) {
- if (completed) {
- this.$modal.hide("pos-loader")
- } else {
- this.$modal.show("pos-loader")
- }
- }
- },
- methods: {
- beforeClose(e) {
- if (!this.loaded) {
- e.stop()
- }
- },
- ...mapActions([
- 'clear'
- ])
- },
- mounted() {
- this.clear()
- this.$modal.show("pos-loader")
- }
- }
- </script>
- <style lang="sass">
- </style>
|