Skip to content

Commit

Permalink
fix: resolve util function (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobbieGoede committed Nov 4, 2023
1 parent 2ae95c1 commit 38e1c7f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/vue-i18n-routing/src/compatibles/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export function isV4Router(val: Router | VueRouter): val is Router {
* This will cause vue-router to issue a warning, so we can work-around by using `router.options.routes`.
*/
export function resolve(router: Router | VueRouter, route: RouteLocationPathRaw, strategy: Strategies, locale: Locale) {
if (isV4Router(router)) {
if (!isV4Router(router)) {
return router.resolve(route)
}

Expand All @@ -121,7 +121,7 @@ export function resolve(router: Router | VueRouter, route: RouteLocationPathRaw,
const _route = router.options?.routes?.find(r => r.path === targetPath)

if (_route == null) {
return router.resolve(route)
return route
}

const _resolvableRoute = assign({}, route, _route)
Expand Down

0 comments on commit 38e1c7f

Please sign in to comment.