Closed pengzhanbo closed 1 month ago
Changes Missing Coverage | Covered Lines | Changed/Added Lines | % | ||
---|---|---|---|---|---|
packages/client/src/router/resolveRouteFullPath.ts | 0 | 3 | 0.0% | ||
packages/client/src/router/resolveRoute.ts | 0 | 5 | 0.0% | ||
packages/client/src/router/resolveRoutePath.ts | 0 | 9 | 0.0% | ||
<!-- | Total: | 8 | 25 | 32.0% | --> |
Totals | |
---|---|
Change from base Build 9211217292: | -0.1% |
Covered Lines: | 690 |
Relevant Lines: | 1721 |
changing fullPath to path in client/dist/app.js like so fixes the issue with query strings ... router.beforeResolve(async (to, from) => { if (to.path !== from.path || from === START_LOCATION) { const route = resolveRoute(to.path); ...
Not sure what's the exact difference and why it worked up to rc8 (at least) and broke with rc11 Also not sure about side effects ...
you have const fullPath = to.fullPath.split('#')[0]
Will fix hash but not query parms, right?
changing fullPath to path in client/dist/app.js like so fixes the issue with query strings ... router.beforeResolve(async (to, from) => { if (to.path !== from.path || from === START_LOCATION) { const route = resolveRoute(to.path); ...
Not sure what's the exact difference and why it worked up to rc8 (at least) and broke with rc11 Also not sure about side effects ...
you have const fullPath = to.fullPath.split('#')[0]
Will fix hash but not query parms, right?
The bug was caused by the fact that vuepress internally needs to resolve the route to obtain the route instance through pathname
, but route.fullPath
contains pathname
, query
, hash
, and other content, leading to parsing errors and failure to match the route instance.
You can refer to the changes made in this PR submission for more information.
I updated the pr to improve the original fix performance.
Also now API are unified to avoid misleading.
All parameters which is expected with no hash and queries are renamed as pathname
The above function are named with "Route Path`
Any parameters which may have hash and queries are called path
The above functions are named with "Route Full Path"
Before submitting the PR, please make sure you do the following
close #123
).What is the purpose of this pull request?
Description
fix: #1561