Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to Dynamically Generate Dynamic Breadcrumbs #2305

Closed
thorge opened this issue Oct 4, 2024 · 1 comment
Closed

Unable to Dynamically Generate Dynamic Breadcrumbs #2305

thorge opened this issue Oct 4, 2024 · 1 comment
Labels
question Further information is requested

Comments

@thorge
Copy link

thorge commented Oct 4, 2024

I am trying to create breadcrumbs that dynamically reflect route parameters in Nuxt, specifically for routes with dynamic segments. For example, when editing a user at the route /users/:userId/edit, the breadcrumbs should look like this: Users > :userId > Edit.

I understand that I can use overrides with useBreadcrumbItems() to manually define the breadcrumb structure, but the challenge arises when different routes require different overrides. Since useBreadcrumbItems() can only be used at the top level of the setup function, I am unable to recreate or modify the breadcrumb items based on route changes. This results in errors when trying to update the breadcrumbs dynamically as the route changes.

Is there a recommended way to handle this scenario where breadcrumbs need to be updated dynamically based on route parameters?

@thorge thorge added the question Further information is requested label Oct 4, 2024
@thorge
Copy link
Author

thorge commented Oct 4, 2024

Apologies, I mistakenly posted this issue in the wrong repository. This is actually related to the nuxt-seo package. I've reopened the issue at: harlan-zw/nuxt-seo#327

@thorge thorge closed this as completed Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant