[Vuejs]-How to redirect to desired page in Vue js using vue-router?

1👍

If I’ve understood correctly you need to use the value which is being passed via the redirect parameter

This should be done in your login function if login is successful, you haven’t shared your login function but something like this:

loginUser() {
    this.$store.dispatch('loginUser', {
        email: this.email,
        password: this.password
    })
        .then(() => {
            this.$router.push(this.$route.query.redirect)
        })
    }
👤RBowen

Leave a comment