Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

FloatingLabelInput.razor 998 B

il y a 2 semaines
12345678910111213141516171819202122232425262728293031323334353637
  1. @namespace Components
  2. <div class="@BT.FormFloating @CssClass">
  3. <input id="nametxt" placeholder="@PlaceHolder" type="@Type" @bind="@BindingValue" class="@BT.Input @BT.MarginTop(TopMargin)" @bind:event="oninput" />
  4. <label for="nametxt">@PlaceHolder</label>
  5. </div>
  6. @code {
  7. [Parameter]
  8. public string PlaceHolder { set; get; }
  9. private string _value;
  10. [Parameter]
  11. public string BindingValue
  12. {
  13. get => _value;
  14. set
  15. {
  16. if (_value == value) return;
  17. _value = value;
  18. BindingValueChanged.InvokeAsync(value);
  19. ChangeMethod.InvokeAsync();
  20. }
  21. }
  22. [Parameter]
  23. public EventCallback<string> BindingValueChanged { get; set; }
  24. [Parameter]
  25. public string Type { set; get; } = "text";
  26. [Parameter]
  27. public string CssClass{ set; get; }
  28. [Parameter]
  29. public int TopMargin { set; get; } = 3;
  30. [Parameter] public EventCallback ChangeMethod { get; set; } = new();
  31. }