Open mansoorkhan96 opened 1 year ago
I think the above should work okay, however, I've found that I need to set the vnode
to false otherwise it does some weird stuff where the scroll doesn't work (found by having a look at what the redirect()
function does).
Try the following:
const props = defineProps({ redirectUrl: String })
const { show, close, redirect, vnode } = useModal()
const handleRedirect = () => {
if (props.redirectUrl) {
vnode.value = false
router.get(props.redirectUrl)
} else {
redirect()
}
}
I agree that a url parameter for the redirect function would be good though.
I have a situation where i redirect users conditionally. Would love know if there is a possibility to optionally pass a URL to the redirect() function of useModal() so that it redirects to intended page instead of baseRoute.
Here is what i am trying as a word around.