Created
May 17, 2020 00:02
-
-
Save gavilanch/feed19c978345b16480dd9aad18e397c 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>Fecha Entrada</label> | |
<input type="text" class="form-control datetimepicker-input" id="fechaEntrada" data-toggle="datetimepicker" data-target="#fechaEntrada" /> | |
</div> | |
<div class="form-group"> | |
<label>Fecha Salida</label> | |
<input type="text" class="form-control datetimepicker-input" id="fechaSalida" data-toggle="datetimepicker" data-target="#fechaSalida" /> | |
</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