1👍
✅
What doesn’t work in your setup? Imagine you can check data.page before changing route:
<template>
<NuxtPage />
</template>
<script setup>
// here some shortened logic
const router = useRouter()
const route = useRoute().fullPath;
try {
const data = new RequestToBe(route).send();
console.log(data) // { page: 'post', ... }
if (data.page === 'post') {
// go to post page
router.push('/post')
} else {
// or do something else
}
} catch (error) {
// something went wrong
console.log(error)
}
</script>
👤jjj
Source:stackexchange.com