mirror of https://github.com/abpframework/abp.git
4 changed files with 39 additions and 2 deletions
@ -0,0 +1,19 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using JetBrains.Annotations; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming; |
|||
|
|||
public class AbpDynamicComponentOptions |
|||
{ |
|||
/// <summary>
|
|||
/// Used to define components that renders in the layout
|
|||
/// </summary>
|
|||
[NotNull] |
|||
public Dictionary<Type, IDictionary<string,object>?> Components { get; set; } |
|||
|
|||
public AbpDynamicComponentOptions() |
|||
{ |
|||
Components = new Dictionary<Type, IDictionary<string, object>?>(); |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
@if (AbpDynamicComponentOptions.Value.Components.Any()) |
|||
{ |
|||
foreach (var (componentType, parameters) in AbpDynamicComponentOptions.Value.Components) |
|||
{ |
|||
<DynamicComponent Type="@componentType" Parameters="@parameters" /> |
|||
} |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
using Microsoft.AspNetCore.Components; |
|||
using Microsoft.Extensions.Options; |
|||
|
|||
namespace Volo.Abp.AspNetCore.Components.Web.Theming.Components; |
|||
|
|||
public partial class AbpDynamicComponents : ComponentBase |
|||
{ |
|||
[Inject] |
|||
protected IOptions<AbpDynamicComponentOptions> AbpDynamicComponentOptions { get; set; } |
|||
} |
|||
Loading…
Reference in new issue