Closed Achneoder closed 10 months ago
This is working as intended: encoding is done in params and query. Passing a path string lets the browser encode it (https://router.vuejs.org/guide/migration/#-route-properties-Encoding). This is why it's recommended to use named routes with params if params can contain encoded characters 🙂
Reproduction
https://github.com/vuejs/router/compare/main...Achneoder:router:test_path_encoding
Steps to reproduce the bug
test_path_encoding
pnpm i
pnpm test
Expected behavior
The test succeeds.
Actual behavior
The test fails.
Additional information
According to the documentation, router.resolve should return a
RouteLocation
with encoded fullPath (same forpath
).I don't know if the current behavior is intended, so that the provided path and/or params already have to be encoded, but that might be inconsistent since the query params will be encoded properly.