Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
dd33ecc to
2873b63
Compare
2873b63 to
5cc0842
Compare
| const route = useRoute() | ||
| const router = useRouter() | ||
|
|
||
| const packageName = computed(() => { | ||
| const { org, name } = route.params as { org?: string; name: string } | ||
| return org ? `${org}/${name}` : (name as string) | ||
| }) |
There was a problem hiding this comment.
Since we enables the experimental typed pages (ref. Experimental Features · Nuxt Advanced v4), you can get the fully typed route with this:
| const route = useRoute() | |
| const router = useRouter() | |
| const packageName = computed(() => { | |
| const { org, name } = route.params as { org?: string; name: string } | |
| return org ? `${org}/${name}` : (name as string) | |
| }) | |
| const route = useRoute('package-version') | |
| const router = useRouter() | |
| const packageName = computed(() => { | |
| const { org, name } = route.params | |
| return org ? `${org}/${name}` : name | |
| }) |
There was a problem hiding this comment.
Since we enables the experimental typed pages (ref. Experimental Features · Nuxt Advanced v4), you can get the fully typed route with this:
Thanks for mentioning that! I will fix this before sending the request.
Because this PR is still WIP and I'm tweaking the UX details, I'm using as and other shortcuts to cheat the type system for now — saves tokens for both AI and my brain. 😉
5cc0842 to
5fd65b8
Compare
5fd65b8 to
35bdb74
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
🔗 Linked issue
Resolves #1846
🧭 Context
📚 Description