Skip to content

Instantly share code, notes, and snippets.

@vmussak
Created March 27, 2018 18:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vmussak/c06c2ed808fc4bd5f206a232b35365f6 to your computer and use it in GitHub Desktop.
Save vmussak/c06c2ed808fc4bd5f206a232b35365f6 to your computer and use it in GitHub Desktop.
Contador com parametros
@page "/counter"
<h1>Counter</h1>
<p>Current count: @currentCount</p>
<button @onclick(IncrementCount(2))>Click me</button>
@functions {
int currentCount = 0;
Action IncrementCount(int a)
{
return () =>
{
currentCount = currentCount + a;
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment