Skip to content

Commit a8a6e24

Browse files
committed
feat: cria componente básico para exibr produtos
1 parent 879305b commit a8a6e24

2 files changed

Lines changed: 24 additions & 6 deletions

File tree

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<table class="table table-striped table-bordered">
2+
<thead>
3+
<tr>
4+
<th>Id</th>
5+
<th>Título</th>
6+
</tr>
7+
</thead>
8+
<tbody>
9+
@foreach (var product in Products)
10+
{
11+
<tr>
12+
<th>@product.Id</th>
13+
<th>@product.Title</th>
14+
</tr>
15+
}
16+
</tbody>
17+
</table>
18+
19+
@code {
20+
21+
[Parameter]
22+
public IEnumerable<Product> Products { get; set; } = [];
23+
}

src/BlazingShop/Pages/Products.razor

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,7 @@
44

55
<h1>Products</h1>
66

7-
<ul>
8-
@foreach (var product in _products)
9-
{
10-
<li>@product.Title</li>
11-
}
12-
</ul>
7+
<ProductTableList Products="_products" />
138

149
@code {
1510
private List<Product> _products = [];

0 commit comments

Comments
 (0)