You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
0 commit comments