You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 24, 2026. It is now read-only.
In addition to useRoute() I think that definePage's redirectto param should be automatically typed as well:
definePage({
redirect: (to) => ({
name: '/members/[id]/roles',
// params: { id: route.params.id }
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion -- we know where we are
params: { id: (to.params as RouteNamedMap['/members/[id]']['params']).id }
})
})
That's because you can't refer to useRoute inside definePage or you will get the following error:
[unplugin-vue-router] `definePage()` in <script setup> cannot reference locally declared variables (route) because it will be hoisted outside of the setup() function.