tests/inputs/Counter.razor
raw| 1 | @* |
| 2 | https://docs.microsoft.com/en-us/aspnet/core/tutorials/build-your-first-blazor-app?view=aspnetcore-3.1 |
| 3 | *@ |
| 4 | @page "/counter" |
| 5 | |
| 6 | <h1>Counter</h1> |
| 7 | |
| 8 | <p>Current count: @currentCount</p> |
| 9 | |
| 10 | <button class="btn btn-primary" @onclick="IncrementCount">Click me</button> |
| 11 | |
| 12 | @code { |
| 13 | private int currentCount = 0; |
| 14 | |
| 15 | [Parameter] |
| 16 | public int IncrementAmount { get; set; } = 1; |
| 17 | |
| 18 | private void IncrementCount() |
| 19 | { |
| 20 | currentCount += IncrementAmount; |
| 21 | } |
| 22 | } |