Merge pull request #5914 from sbwalker/dev
add ability for menu component to support arbitrary attributes
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user