Skip to content

Commit 38e1c7f

Browse files
authored
fix: resolve util function (#80)
1 parent 2ae95c1 commit 38e1c7f

File tree

1 file changed

+2
-2
lines changed
  • packages/vue-i18n-routing/src/compatibles

1 file changed

+2
-2
lines changed

packages/vue-i18n-routing/src/compatibles/utils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ export function isV4Router(val: Router | VueRouter): val is Router {
104104
* This will cause vue-router to issue a warning, so we can work-around by using `router.options.routes`.
105105
*/
106106
export function resolve(router: Router | VueRouter, route: RouteLocationPathRaw, strategy: Strategies, locale: Locale) {
107-
if (isV4Router(router)) {
107+
if (!isV4Router(router)) {
108108
return router.resolve(route)
109109
}
110110

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

123123
if (_route == null) {
124-
return router.resolve(route)
124+
return route
125125
}
126126

127127
const _resolvableRoute = assign({}, route, _route)

0 commit comments

Comments
 (0)