Skip to content

Commit 4a7e13c

Browse files
committed
feat: configura bindings de campos de formulário
1 parent 2ea3244 commit 4a7e13c

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/BlazingShop/Products/CreateProduct/CreateProductPage.razor

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,14 @@
44

55
<h1>New Product</h1>
66

7-
<EditForm Model="_model">
7+
<EditForm Model="_model" OnValidSubmit="@HandleSubmitAsync">
8+
<div class="mb-3">
9+
<label for="title" class="form-label">Title</label>
10+
<InputText id="title" class="form-control" @bind-Value="_model.Title" />
11+
</div>
12+
13+
<div class="mb-3">
14+
<label for="description" class="form-label">Description</label>
15+
<InputTextArea id="description" class="form-control" @bind-Value="_model.Description" />
16+
</div>
817
</EditForm>

src/BlazingShop/Products/CreateProduct/CreateProductPage.razor.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
public partial class CreateProductPage
44
{
55
private readonly CreateProductInput _model = new();
6+
7+
async Task HandleSubmitAsync() { }
68
}

0 commit comments

Comments
 (0)