Automagical @page directive #14186
Labels
area-blazor
Includes: Blazor, Razor Components
enhancement
This issue represents an ask for new feature or an enhancement to an existing one
✔️ Resolution: Duplicate
Resolved as a duplicate of another issue
Is your feature request related to a problem? Please describe.
Sometimes people forget to put
@page
on their pages, but this information can be derived from the pre-build directory structure anyway.Describe the solution you'd like
Pre-build, .razor pages could have
@page
added to them, with the lowercase version of the filename without its extension. The path would come from the project's folders, and the root would be the location of the App.razor file.For example, App.razor is in the razor folder. There are pages in pages and components folders under the razor folder. The Counter.razor file in the pages directory would automatically - if one has not been provided - get prepended with
@page("/pages/counter")
while the DataView.razor file in the components folder would be prepended with@page("/components/dataview")
The text was updated successfully, but these errors were encountered: