parent
a71b3ffe35
commit
c34cc04d89
@ -0,0 +1,50 @@
|
|||||||
|
<CascadingValue Value="@this">
|
||||||
|
<div class="container">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-6">
|
||||||
|
|
||||||
|
<div>Available items:</div>
|
||||||
|
<div>
|
||||||
|
<div class="css-grid">
|
||||||
|
|
||||||
|
@foreach (var item in Items)
|
||||||
|
{
|
||||||
|
<CraftingItem Item="item" NoDrop="true" />
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
<div>Recipe</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div class="css-recipe">
|
||||||
|
<CraftingItem Index="0" />
|
||||||
|
<CraftingItem Index="1" />
|
||||||
|
<CraftingItem Index="2" />
|
||||||
|
<CraftingItem Index="3" />
|
||||||
|
<CraftingItem Index="4" />
|
||||||
|
<CraftingItem Index="5" />
|
||||||
|
<CraftingItem Index="6" />
|
||||||
|
<CraftingItem Index="7" />
|
||||||
|
<CraftingItem Index="8" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>Result</div>
|
||||||
|
<div>
|
||||||
|
<CraftingItem Item="RecipeResult" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-12">
|
||||||
|
<div>Actions</div>
|
||||||
|
<div class="actions" id="actions">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CascadingValue>
|
@ -0,0 +1,14 @@
|
|||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
|
||||||
|
[CascadingParameter]
|
||||||
|
public MyRootComponent RootComponent { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<div style="border: 1px solid black; padding: 10px;">
|
||||||
|
<strong>MyFirstChildComponent - @RootComponent.Text</strong>
|
||||||
|
<div>
|
||||||
|
@ChildContent
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,16 @@
|
|||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string Text { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<div style="border: 1px solid black; padding: 10px;">
|
||||||
|
<strong>MyRootComponent - @Text</strong>
|
||||||
|
<div>
|
||||||
|
<CascadingValue Value="@this">
|
||||||
|
@ChildContent
|
||||||
|
</CascadingValue>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -0,0 +1,14 @@
|
|||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public RenderFragment ChildContent { get; set; }
|
||||||
|
|
||||||
|
[CascadingParameter]
|
||||||
|
public MyRootComponent RootComponent { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
<div style="border: 1px solid black; padding: 10px;">
|
||||||
|
<strong>MySecondChildComponent - @RootComponent.Text</strong>
|
||||||
|
<div>
|
||||||
|
@ChildContent
|
||||||
|
</div>
|
||||||
|
</div>
|
Loading…
Reference in new issue