Reputation: 588
I’d like to add a custom value to the page title in my Blazor app.
I’m currently using the native <title></title>
component which doesn’t pass any values other than each pages name.
I’d like to have a page title convention like this:
App name | page name
Upvotes: 1
Views: 317
Reputation: 75
You can create your Custom component for title. Here's how you can do that.
<title>App Name | @Title</title>
@code {
[Parameter, EditorRequired]
public string Title { get; set; } = "";
}
@page "/"
<CustomPageTitle Title="Page 1"></CustomPageTitle>
<h1>Hello World</h1>
Upvotes: 0