-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support passing assigned render mode via parameter builder
- Loading branch information
1 parent
9609439
commit 0e2dbc1
Showing
7 changed files
with
101 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
tests/bunit.testassets/RenderModes/SectionOutletComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Microsoft.AspNetCore.Components.Web; | ||
|
||
#if NET8_0_OR_GREATER | ||
using Microsoft.AspNetCore.Components.Sections; | ||
#endif | ||
|
||
namespace Bunit.TestAssets.RenderModes; | ||
|
||
public class SectionOutletComponent : ComponentBase | ||
{ | ||
#if NET8_0_OR_GREATER | ||
private static readonly Guid SectionId = Guid.NewGuid(); | ||
#endif | ||
|
||
[Parameter] public RenderFragment ChildContent { get; set; } | ||
|
||
protected override void BuildRenderTree(RenderTreeBuilder builder) | ||
{ | ||
#if NET8_0_OR_GREATER | ||
builder.OpenComponent<SectionOutlet>(0); | ||
builder.AddComponentParameter(1, nameof(SectionOutlet.SectionId), SectionId); | ||
builder.AddComponentRenderMode(RenderMode.InteractiveWebAssembly); | ||
builder.CloseComponent(); | ||
builder.OpenComponent<SectionContent>(10); | ||
builder.AddComponentParameter(11, nameof(SectionContent.SectionId), SectionId); | ||
builder.AddAttribute(12, nameof(SectionContent.ChildContent), ChildContent); | ||
builder.CloseComponent(); | ||
#endif | ||
} | ||
} |
12 changes: 0 additions & 12 deletions
12
tests/bunit.testassets/RenderModes/SectionOutletComponent.razor
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters