Browse Source

Merge pull request #22348 from abpframework/auto-merge/rel-9-1/3529

Merge branch dev with rel-9.1
pull/22350/head
maliming 2 years ago
committed by GitHub
parent
commit
c3789233b4
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 19
      docs/en/framework/ui/blazor/navigation-menu.md

19
docs/en/framework/ui/blazor/navigation-menu.md

@ -123,6 +123,25 @@ if (await context.IsGrantedAsync("MyPermissionName"))
> You can use `context.AuthorizationService` to directly access to the `IAuthorizationService`.
### Custom Components
Custom components can be used to render the menu items instead of the default components of the theme. The extension method named `UseComponent` from `Volo.Abp.UI.Navigation` namespace can be used to set a custom component for a menu item.
**Example: Set a custom component for a menu item**
```csharp
context.Menu.Items.Add(
new ApplicationMenuItem("MyProject.Crm.About", "About", "/about")
.UseComponent<AboutMenuItemComponent>()
);
```
_AboutMenuItemComponent.razor component will be renderd for the menu item._
### Resolving Dependencies
`context.ServiceProvider` can be used to resolve any service dependency.

Loading…
Cancel
Save