Created
May 9, 2020 13:02
-
-
Save gavilanch/59175f455ca433e4b87338bda32e3224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @page "/counter" | |
| @inject IJSRuntime js | |
| <div @ref="container"> | |
| <h1>Counter</h1> | |
| <p>Current count: @currentCount</p> | |
| <button @ref="miBoton" id="counterClick" class="btn btn-primary counterClickC" @onclick="IncrementCount">Click me</button> | |
| </div> | |
| @code { | |
| private ElementReference container; | |
| protected async override Task OnAfterRenderAsync(bool firstRender) | |
| { | |
| if (firstRender) | |
| { | |
| await js.InvokeVoidAsync("initializeCounterComponent", container); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment