This almost works. Clicking Increment and Decrement works. But if I try to change the increment value, the value stays at 1 regardless.
@page "/counter"
<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button class="btn btn-primary" @onclick="IncrementCount" disabled="@(currentCount>10)">Click me +</button>
<button class="btn btn-primary" @onclick="DecrementCount" disabled="@(currentCount==0)">Click Me -</button>
<input type="number" bind="@increment" />
@functions {
int currentCount = 0;
int increment = 1;
void IncrementCount()
{
currentCount+=increment;
}
void DecrementCount()
{
currentCount--;
}
}