vue-i18n-routing
Advanced tools
Comparing version 1.0.1-1eabc82 to 1.0.1-f6920dd
@@ -620,2 +620,16 @@ "use strict"; | ||
} | ||
function routeToObject(route) { | ||
const { fullPath, query, hash, name, path, params, meta, redirectedFrom, matched } = route; | ||
return { | ||
fullPath, | ||
params, | ||
query, | ||
hash, | ||
name, | ||
path, | ||
meta, | ||
matched, | ||
redirectedFrom | ||
}; | ||
} | ||
function resolve(router, route, strategy, locale) { | ||
@@ -766,3 +780,4 @@ if (vueDemi.isVue3 && strategy === "prefix") { | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey } = getI18nRoutingOptions(this.router, this); | ||
const { params, ...routeCopy } = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeValue = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeCopy = routeToObject(routeValue); | ||
const langSwitchParams = getLocalizableMetaFromDynamicParams(route, dynamicRouteParamsKey)[locale] || {}; | ||
@@ -772,3 +787,3 @@ const _baseRoute = { | ||
params: { | ||
...params, | ||
...routeCopy.params, | ||
...langSwitchParams | ||
@@ -778,3 +793,3 @@ } | ||
if (vueDemi.isVue2) { | ||
_baseRoute.params[0] = params.pathMatch; | ||
_baseRoute.params[0] = routeCopy.params.pathMatch; | ||
} | ||
@@ -781,0 +796,0 @@ const baseRoute = assign({}, routeCopy, _baseRoute); |
@@ -617,2 +617,16 @@ var VueI18nRouting = function(exports, VueRouter3, vueDemi, vueI18nBridge) { | ||
} | ||
function routeToObject(route) { | ||
const { fullPath, query, hash, name, path, params, meta, redirectedFrom, matched } = route; | ||
return { | ||
fullPath, | ||
params, | ||
query, | ||
hash, | ||
name, | ||
path, | ||
meta, | ||
matched, | ||
redirectedFrom | ||
}; | ||
} | ||
function resolve(router, route, strategy, locale) { | ||
@@ -763,3 +777,4 @@ if (vueDemi.isVue3 && strategy === "prefix") { | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey } = getI18nRoutingOptions(this.router, this); | ||
const { params, ...routeCopy } = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeValue = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeCopy = routeToObject(routeValue); | ||
const langSwitchParams = getLocalizableMetaFromDynamicParams(route, dynamicRouteParamsKey)[locale] || {}; | ||
@@ -769,3 +784,3 @@ const _baseRoute = { | ||
params: { | ||
...params, | ||
...routeCopy.params, | ||
...langSwitchParams | ||
@@ -775,3 +790,3 @@ } | ||
if (vueDemi.isVue2) { | ||
_baseRoute.params[0] = params.pathMatch; | ||
_baseRoute.params[0] = routeCopy.params.pathMatch; | ||
} | ||
@@ -778,0 +793,0 @@ const baseRoute = assign({}, routeCopy, _baseRoute); |
@@ -620,2 +620,16 @@ "use strict"; | ||
} | ||
function routeToObject(route) { | ||
const { fullPath, query, hash, name, path, params, meta, redirectedFrom, matched } = route; | ||
return { | ||
fullPath, | ||
params, | ||
query, | ||
hash, | ||
name, | ||
path, | ||
meta, | ||
matched, | ||
redirectedFrom | ||
}; | ||
} | ||
function resolve(router, route, strategy, locale) { | ||
@@ -766,3 +780,4 @@ if (vueDemi.isVue3 && strategy === "prefix") { | ||
const { switchLocalePathIntercepter, dynamicRouteParamsKey } = getI18nRoutingOptions(this.router, this); | ||
const { params, ...routeCopy } = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeValue = vueDemi.isVue3 ? route : vueDemi.isRef(route) ? route.value : route; | ||
const routeCopy = routeToObject(routeValue); | ||
const langSwitchParams = getLocalizableMetaFromDynamicParams(route, dynamicRouteParamsKey)[locale] || {}; | ||
@@ -772,3 +787,3 @@ const _baseRoute = { | ||
params: { | ||
...params, | ||
...routeCopy.params, | ||
...langSwitchParams | ||
@@ -778,3 +793,3 @@ } | ||
if (vueDemi.isVue2) { | ||
_baseRoute.params[0] = params.pathMatch; | ||
_baseRoute.params[0] = routeCopy.params.pathMatch; | ||
} | ||
@@ -781,0 +796,0 @@ const baseRoute = assign({}, routeCopy, _baseRoute); |
{ | ||
"name": "vue-i18n-routing", | ||
"description": "The i18n routing with using vue-i18n", | ||
"version": "1.0.1-1eabc82", | ||
"version": "1.0.1-f6920dd", | ||
"dependencies": { | ||
@@ -6,0 +6,0 @@ "@intlify/shared": "^9.3.0", |
Sorry, the diff of this file is not supported yet
207387
5742