vuejs / vue-router

🚦 The official router for Vue 2
http://v3.router.vuejs.org/
MIT License
18.99k stars 5.06k forks source link

In Vue vite, router.push() does not render page although it does navigate to a new URL #3876

Closed techsellingman closed 9 months ago

techsellingman commented 9 months ago

I want to navigate to homepage after login. It goes to a new url, but does not render the page. It was still loading login page although it was navigated.

This is the code snippet.

async userSignin({ commit }, data) {
    const signinData = {
        email: data.email,
        password: data.password,
    };

    const response = await APIs.USER_SIGNIN(signinData);
    const { email, token } = response;

    if (token) {
        commit("SIGNIN_SUCCESS", response);
        router.push("/");
        console.log(1)
    } else {
        return Toast.fire({
            icon: "error",
            title: "Incorrect email or password.",
        });
    }
}
posva commented 9 months ago

Hi, thanks for your interest but Github issues are for bug reports and feature requests only. You can ask questions on the forum, the Discord server or StackOverflow.