newBranch
Victor Perez NGOUNOU 2 years ago
parent cdf25d55d6
commit 11aa501e71

@ -0,0 +1,9 @@
<h3>Card</h3>
@using TP_Blazor.Models
@typeparam TItem
<div class="card text-center">
@CardHeader(Item)
@CardBody(Item)
@CardFooter
</div>

@ -0,0 +1,18 @@
using Microsoft.AspNetCore.Components;
namespace TP_Blazor.Components;
public partial class Card<TItem>
{
[Parameter]
public RenderFragment<TItem> CardBody { get; set; }
[Parameter]
public RenderFragment CardFooter { get; set; }
[Parameter]
public RenderFragment<TItem> CardHeader { get; set; }
[Parameter]
public TItem Item { get; set; }
}

@ -0,0 +1,8 @@
namespace TP_Blazor.Models;
public class Cake
{
public int Id { get; set; }
public string Name { get; set; }
public decimal Cost { get; set; }
}

@ -0,0 +1,13 @@
using TP_Blazor.Models;
namespace TP_Blazor.Pages;
public partial class Index
{
private Cake CakeItem = new Cake
{
Id = 1,
Name = "Black Forest",
Cost = 50
};
}
Loading…
Cancel
Save