Created
May 17, 2020 01:28
-
-
Save gavilanch/62153c3d7f8e259e518dba3c9da2d7a6 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" class="counter-container"> | |
<h1>Counter</h1> | |
<p>Current count: @currentCount</p> | |
<div class="form-group"> | |
<button id="counterClick" class="btn btn-primary counterClickC" @onclick="IncrementCount">Click me</button> | |
</div> | |
<div class="form-group"> | |
<label>Date Start</label> | |
<input type="text" class="form-control datetimepicker-input" id="dateStart" data-toggle="datetimepicker" data-target="#dateStart" /> | |
</div> | |
<div class="form-group"> | |
<label>Date End</label> | |
<input type="text" class="form-control datetimepicker-input" id="dateEnd" data-toggle="datetimepicker" data-target="#dateEnd" /> | |
</div> | |
<div style="width: 500px;"> | |
<h5>Gráfico Importante</h5> | |
<canvas id="myChart"></canvas> | |
</div> | |
</div> | |
@code { | |
private int currentCount = 0; | |
private ElementReference container; | |
protected async override Task OnAfterRenderAsync(bool firstRender) | |
{ | |
if (firstRender) | |
{ | |
await js.InvokeVoidAsync("initializeCounterComponent", container); | |
} | |
} | |
private void IncrementCount() | |
{ | |
currentCount++; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment