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

fix: navigate to other collection page with query #301

Closed
wants to merge 1 commit into from

Conversation

cyanxxx
Copy link
Contributor

@cyanxxx cyanxxx commented Apr 7, 2024

Description

Linked Issues

#300

Additional context

@@ -47,7 +47,7 @@ const collections = computed(() => {
</div>

<!-- Collections -->
<RouterLink
<QueryRouterLink
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder why you end up with this solution? I would avoid patching built-in components as much as possible (also it would cause problem if we forget to use the patched version in future changes)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, patched component shouldn't be used here. How about handling this in the collection/[id].vue file with the onBeforeRouteUpdate hook? If navigating to another collection and the before route with a query, it will overwrite the current route query.
As for the click event problem, the RouterLink with the click handler is not frequently used. How about also removing the patched component?

@antfu antfu closed this in b44e2a9 Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants