'How to redirect to thank you page in Vue3.js
How can I create a redirect to another page on Vue?
Below I would like to insert a redirect after user login.
async function normalLoginClicked() {
if(agreePrivacyPolicy.value) {
ps_loading_dialog.value.openModal();
await userProvider.loginWithEmailId(email.value, password.value);
ps_loading_dialog.value.closeModal();
if (userProvider.userResource.status == PsStatus.SUCCESS) {
redirect();
}
}
function redirect() {
userProvider.navigateUserLoginRedirect(route.query.redirect, 'dashboard', router, route.query.redirect, route.query, route.params);
}
Solution 1:[1]
The way to move on a client-side context is to use the following after your await
router.push('/my-cool/path-redirection')
As explained here: https://router.vuejs.org/guide/essentials/navigation.html#navigate-to-a-different-location
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | kissu |