-
-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Route name missing for routes that have children
With page structure like ``` pages/posts.vue pages/posts/extra.vue ``` `posts.vue` is a parent route and `extra.vue` is a child route. Former has `posts` name and latter has `posts_extra` name. Removing name from parent route makes parent route inaccessible through name and thus breaks internal functions like `localePath` and `switchLocalePath`. Fix by not removing names from routes. And also checking if name exists at all before trying to add locale as with some file structures, for example: ``` pages/posts.vue pages/posts/index.vue ``` the parent `posts.vue` route has no name as `posts` name is assigned to child and child is shown by default when going to /posts. Trying to add locale in that case ended up with route named `undefined_xx`. Resolves #356
- Loading branch information
Showing
2 changed files
with
20 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters