Skip to content

Commit

Permalink
fix($core): decode regularPath when generate router config
Browse files Browse the repository at this point in the history
vue-router can't match path contains encoded string like Chinese, when using permalink.

fix vuejs#1946
  • Loading branch information
fangbinwei committed Oct 13, 2019
1 parent c56d889 commit ffdc807
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/@vuepress/core/lib/node/internal-plugins/routes.js
Expand Up @@ -65,10 +65,12 @@ function routesCode (pages) {
}`
}

if (regularPath !== pagePath) {
const decodedRegularPath = decodeURIComponent(regularPath)

if (decodedRegularPath !== pagePath) {
code += `,
{
path: ${JSON.stringify(regularPath)},
path: ${JSON.stringify(decodedRegularPath)},
redirect: ${JSON.stringify(pagePath)}
}`
}
Expand Down

0 comments on commit ffdc807

Please sign in to comment.