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