Skip to content

Commit

Permalink
fix: Preserve route params in base route
Browse files Browse the repository at this point in the history
  • Loading branch information
paulgv committed Jan 20, 2019
1 parent dcd1f79 commit 13b2e73
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/plugins/routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ function switchLocalePathFactory (i18nPath) {
if (!name) {
return ''
}

const { params, ...routeCopy } = this.$route
const baseRoute = Object.assign({}, routeCopy, { name, params: { '0': params.pathMatch } })
const baseRoute = Object.assign({}, routeCopy, {
name,
params: { ...params, '0': params.pathMatch }
})
let path = this.localePath(baseRoute, locale)

// Handle different domains
Expand Down

0 comments on commit 13b2e73

Please sign in to comment.