Вход на сайт
Не забываем - .NET Conf 2024 на подходе
620 просмотров
Перейти к просмотру всей ветки
в ответ AlexNek 09.11.24 10:50
Спасибо.
Про фичи языка - проще потом в МСДНе прочитать выдержку уже утверждённых вещей с примерами.
Вот тут что-то не понял - юзает атрибут, а в контроле руками вбивает. А где привязки, берущие значения из атрибутов, да чтобы не сам руками, а автоматом подхватывалось?
Range Input Support in InputNumber<TValue>
Component
The InputNumber<TValue>
component now supports the type="range"
attribute, allowing for range inputs like sliders or dials. This feature supports model binding and form validation, offering a more interactive way to input numerical data compared to the traditional text box.
<EditForm>
<InputNumber @bind-Value="Model.ProductCount" max="999" min="1" step="1" type="range" />
</EditForm>
@code {
public class MyModel
{
[Required, Range(minimum: 1, maximum: 999)]
public int ProductCount { get; set; }
}
}