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: useLocalePath has no type access to route #130

Closed
dargmuesli opened this issue Dec 1, 2023 · 2 comments
Closed

fix: useLocalePath has no type access to route #130

dargmuesli opened this issue Dec 1, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@dargmuesli
Copy link
Contributor

In

export function useLocalePath(options?: Pick<NonNullable<Parameters<typeof _useLocalePath>[0]>, 'i18n'>): TypedToLocalePath {

why pick 'i18n' only?

In a middleware I want to use

defineNuxtRouteMiddleware(async (to) => {
      const localePath = useLocalePath({ route: to })
})

but am currently not able to, at least type wise.

I'd propose to add | 'route', or even drop the pick.

@victorgarciaesgi
Copy link
Owner

There should have been a reason because of wrong types on @nuxtjs/i18n side.
(It was in beta so things where missing)
I look at it maybe it's not the case anymore

@victorgarciaesgi victorgarciaesgi added the enhancement New feature or request label Dec 1, 2023
@victorgarciaesgi
Copy link
Owner

Fixed in v3.5.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants