ankurk91 / vue-loading-overlay

Vue.js component for full screen loading indicator :cyclone:
https://ankurk91.github.io/vue-loading-overlay/
MIT License
1.25k stars 102 forks source link

Some kind of showDelay option would be nice #59

Open sir-gawain opened 4 years ago

sir-gawain commented 4 years ago

I have something like this in my code:

watch: {
            loading: function (loading) {
                if (loading) {
                    this.loader = this.$loading.show();
                } else {
                    this.loader.hide();
                    this.loader = null;
                }
            }
},

and then on an ajax call i do something like this:

methods: {
            async loadProjekte() {
                this.loading = true;
                this.projekte = await Projekt.get(); // call to server by ajax
                this.loading = false;
            },
},

This works very well, but on short ajax calls, the overlay pops up and hides only microseconds later. It would be very nice to have an option to show() or a global option, that delays the display for some time for me:

this.$loading.show({showDelay: 500});
juni0r commented 2 years ago

Is this still a consideration? I'd be happy to see this implemented.