How to specify route name
See original GitHub issueHello, is there a way how to specify a name for a generated route?
In the default setup, the route name is inferred (hopeI am not mistaken) from the directory structure. That’s cool for smaller not deeply nested routes however it would be handy if I could specify route name in the page component itself.
E.g.: it would be taken from the page component name:
// users/_id/orders/_page.vue
<script>
export default {
name: 'user-orders'
}
</script>
I am sorry if I missed something obvious.
Issue Analytics
- State:
- Created 4 years ago
- Comments:16 (6 by maintainers)
Top Results From Across the Web
Routing - Laravel - The PHP Framework For Web Artisans
Route names should always be unique. Generating URLs To Named Routes. Once you have assigned a name to a given route, you may...
Read more >Add name to laravel route - Stack Overflow
Option 1. Route::get('/novanoticia', 'HomeController@getNovaNoticia')->name('route_name');. Option 2. Route::get('/novanoticia', ['as' ...
Read more >What is the use of Route Name? - Laracasts
Named routes allow you to conveniently generate URLs or redirects for a specific route. You may specify a name for a route using...
Read more >Route Names and Route Orders in Attribute Routing
To specify the route name, we need to set the Name property on the attribute. Let us see an example to understand how...
Read more >Routing to controller actions in ASP.NET Core - Microsoft Learn
The route names give the route a logical name. The named route can be used for URL generation. Using a named route simplifies...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Meanwhile I came up with following workaround:
You have to specify the route name in the route-meta block and then you can override it.
Your page component would look like this:
We cannot specify it currently. Maybe I’ll add
<route-config>
custom block and let specify the name in the block.