Skip to content

Commit

Permalink
fix: useLocalePath has no type access to route #130
Browse files Browse the repository at this point in the history
  • Loading branch information
victorgarciaesgi committed Dec 4, 2023
1 parent 9155dec commit cb0808a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion playground/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineNuxtConfig({
},
srcDir: './src',
i18n: {
// defaultLocale: 'de',
defaultLocale: 'de',
// dynamicRouteParams: true,
locales: [
{
Expand Down
5 changes: 3 additions & 2 deletions src/core/output/generators/files/__i18n-router.file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export function createi18nRouterFile() {
return /* typescript */ `
import type { RouteLocationRaw } from 'vue-router';
import { useLocalePath as _useLocalePath, useLocaleRoute as _useLocaleRoute} from 'vue-i18n-routing';
import type {I18nCommonRoutingOptionsWithComposable} from 'vue-i18n-routing';
import type {TypedRouteLocationRawFromName, TypedLocationAsRelativeRaw, TypedRouteFromName} from './__router';
import type {RoutesNamesList} from './__routes';
${returnIfTrue(
Expand Down Expand Up @@ -48,7 +49,7 @@ export function createi18nRouterFile() {
)}
}
export function useLocalePath(options?: Pick<NonNullable<Parameters<typeof _useLocalePath>[0]>, 'i18n'>): TypedToLocalePath {
export function useLocalePath(options?: I18nCommonRoutingOptionsWithComposable): TypedToLocalePath {
return _useLocalePath(options) as any;
}
Expand All @@ -61,7 +62,7 @@ export function createi18nRouterFile() {
}
export function useLocaleRoute(options?: Pick<NonNullable<Parameters<typeof _useLocaleRoute>[0]>, 'i18n'>): TypedLocaleRoute {
export function useLocaleRoute(options?: I18nCommonRoutingOptionsWithComposable): TypedLocaleRoute {
return _useLocaleRoute(options) as any;
}
Expand Down

0 comments on commit cb0808a

Please sign in to comment.