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
Copy file name to clipboardExpand all lines: components/menu/templates.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ The Menu item template can contain arbitrary content according such as HTML mark
24
24
25
25
### Use ItemTemplate for Navigation
26
26
27
-
The following example shows how to render `<NavLink>` tags inside the Menu and use them for navigation instead of the [built-in Menu navigation mechanism]({%slug menu-navigation%}). This approach requires the URL property name to be different from `Url`. In addition to rendering customization, `<NavLink>` also supports the `target="_blank"` attribute.
27
+
The following example shows how to render `<NavLink>` tags inside the Menu and use them for navigation instead of the [built-in Menu navigation mechanism]({%slug menu-navigation%}). This approach requires the URL property name to be different from `Url`. [`<NavLink>` also supports the `target="_blank"` attribute](#use-itemtemplate-for-styling-and-target_blank).
28
28
29
29
>caption Use Menu item template for navigation
30
30
@@ -153,7 +153,7 @@ The following example shows how to render `<NavLink>` tags inside the Menu and u
153
153
154
154
### Use ItemTemplate for Styling and target="_blank"
155
155
156
-
The example below shows a Menu configuration that is suitable for use in `MainLayout.razor`.
156
+
The example below shows a Menu configuration that is suitable for use in `MainLayout.razor`. The implementation disables the [built-in Menu navigation]({%slug menu-navigation}) because the URL property is not `Url` and `UrlField` is not set. The sample also uses `<NavLink>` tags with `target="_blank"` to open external links in a new browser window.
157
157
158
158
>caption Use Menu item template to distinguish the current page and open external links in new browser windows
0 commit comments