mirror of
https://github.com/PacktPublishing/Web-Development-with-Blazor-Second-Edition.git
synced 2025-12-06 05:32:03 +01:00
17 lines
392 B
Plaintext
17 lines
392 B
Plaintext
<h1>Blazor counter</h1>
|
|
|
|
<p role="status">Current count: @currentCount</p>
|
|
<p>Increment amount: @IncrementAmount</p>
|
|
|
|
<button class="btn btn-primary" @onclick="IncrementCount">Click me</button>
|
|
|
|
@code {
|
|
private int currentCount = 0;
|
|
|
|
[Parameter] public int IncrementAmount { get; set; } = 1;
|
|
|
|
private void IncrementCount()
|
|
{
|
|
currentCount += IncrementAmount;
|
|
}
|
|
} |