Skip to content

Commit ffdc807

Browse files
committed
fix($core): decode regularPath when generate router config
vue-router can't match path contains encoded string like Chinese, when using permalink. fix vuejs#1946
1 parent c56d889 commit ffdc807

File tree

1 file changed

+4
-2
lines changed
  • packages/@vuepress/core/lib/node/internal-plugins

1 file changed

+4
-2
lines changed

packages/@vuepress/core/lib/node/internal-plugins/routes.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,12 @@ function routesCode (pages) {
6565
}`
6666
}
6767

68-
if (regularPath !== pagePath) {
68+
const decodedRegularPath = decodeURIComponent(regularPath)
69+
70+
if (decodedRegularPath !== pagePath) {
6971
code += `,
7072
{
71-
path: ${JSON.stringify(regularPath)},
73+
path: ${JSON.stringify(decodedRegularPath)},
7274
redirect: ${JSON.stringify(pagePath)}
7375
}`
7476
}

0 commit comments

Comments
 (0)