$router doesnt work in pinia #14030
Answered
by
yusufkandemir
wilsntn
asked this question in
General - Components / Directives / etc
-
How can I redirect after a successful login with pinia? login() {
console.log(this.email, this.password);
if (this.email && this.password != null) {
api
.post("/login", { email: this.email, password: this.password })
.then((response) => {
console.log(response.data.acess_token);
LocalStorage.set("token", response.data.acess_token);
// HERE
this.$router.push({ path: "/dashboard/servicos" });
})
.catch((err) => console.log(err));
}
}, I know this cant work but i have no clue how to import Router.push in quasar.. can anyone help me? |
Beta Was this translation helpful? Give feedback.
Answered by
yusufkandemir
Jul 23, 2022
Replies: 2 comments 3 replies
-
It's not |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
wilsntn
-
I solved the problem, was my project structure, it was created to work with vuex and i created another with pinia.. now works fine |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It's not
this.$router
, it'sthis.router
(no $).