@page "/"
@inject IJSRuntime JsRuntime;
<p>
<label for="spinner">Select a value:</label>
<input id="spinner" name="value">
</p>
<p>
<button id="disable" @onclick="@( ()=>JustCall("dissableclick") )" >Toggle disable/enable</button>
<button id="destroy" @onclick="@( ()=>JustCall("destroyclick") )" >Toggle widget</button>
</p>
<p>
<button id="getvalue" @onclick="@( ()=>JustCall("getvalueclick") )" >Get value</button>
<button id="setvalue" @onclick="@( ()=>JustCall("setvalueclick") )" >Set value to 5</button>
</p>
@code {
protected async override Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
await JsRuntime.InvokeAsync<object>("myWrapperKSUIfunctions.initialize");
}
}
protected async Task JustCall(string f) => await JsRuntime.InvokeAsync<object>($"myWrapperKSUIfunctions.{f}");
}