The return of useRouter() is undefined #959
-
.vuepress/client.ts import { defineClientConfig } from "@vuepress/client";
import "./styles/index.scss";
import { useRouter } from "vue-router";
export default defineClientConfig({
setup() {
const router = useRouter(); //undefined
const redirect_uri = sessionStorage.getItem("redirect_uri");
if (redirect_uri) {
router.push(redirect_uri);
}
},
}); |
Beta Was this translation helpful? Give feedback.
Answered by
Mister-Hope
Jun 20, 2022
Replies: 2 comments 3 replies
-
The vuepress version is 2.0.0-beta.46 |
Beta Was this translation helpful? Give feedback.
0 replies
-
Reproduction repo is required. Double check you only have ONE SINGLE VERSION of vue-router in your project. |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
Mister-Hope
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduction repo is required. Double check you only have ONE SINGLE VERSION of vue-router in your project.