Skip to content

Use vue-wait with vue-router and beforeRouteEnter #87

Open
@ahoiroman

Description

Hello everybody,

actually I'd like to use vue-wait with vue-router and beforeRouteEnter

If I'm doing something like

        beforeRouteEnter (to, _from, next) {
            const promises = [
                axios.get ('/api/user/1'),
            ];

            this.$wait.start('loading.users');

            axios.all (promises)
            .then (([userRes]) => {
                next ((vm) => {
                    vm.user = userRes.data.data;
                });
            });
        },

I am getting an error

TypeError: undefined is not an object (evaluating 'this.$wait')
beforeRouteEnter — ....js

So how could I solve this?

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions