add ability for menu component to support arbitrary attributes

This commit is contained in:
sbwalker
2025-12-22 08:37:45 -05:00
parent 15ee2c9bcb
commit 0ad5bd2335

View File

@@ -1,8 +1,8 @@
@namespace Oqtane.Themes.Controls @namespace Oqtane.Themes.Controls
@if (ComponentType != null) @if (_menuType != null)
{ {
<DynamicComponent Type="@ComponentType"></DynamicComponent> <DynamicComponent Type="@_menuType" Parameters="@Attributes"></DynamicComponent>
} }
@code{ @code{
@@ -12,7 +12,10 @@
[Parameter] [Parameter]
public string MenuType { get; set; } public string MenuType { get; set; }
public Type ComponentType { get; set; } [Parameter(CaptureUnmatchedValues = true)]
public Dictionary<string, object> Attributes { get; set; } = new Dictionary<string, object>();
private Type _menuType;
protected override void OnInitialized() protected override void OnInitialized()
{ {
@@ -28,6 +31,6 @@
} }
} }
ComponentType = Type.GetType(MenuType); _menuType = Type.GetType(MenuType);
} }
} }