Input Number

带减号和加号按钮的数字输入框——支持方向键、Page Up / Down 和 Home / End 的 spinbutton,限制在 min 与 max 之间,可作为表单控件。

可用框架
  • Angular: 可用
  • Vue: 可用
  • React: 可用
  • React Native: 可用

用法

2 × €24.00 = €48.00

导入

ts
import {
  SoneInputNumberComponent,
} from "@surface-one/angular/input-number";

API 参考

SoneInputNumberComponent组件

A number field with − and + buttons — a quantity in a cart, a count in a form. The field is a WAI-ARIA spinbutton: ↑ / ↓ step, Page Up / Page Down step × 10, Home / End jump to `min` / `max`; typed text is parsed and clamped on blur or Enter. A ControlValueAccessor of `number | null`, or `[(value)]`.

选择器
sone-input-number
输入
名称类型 默认值
value双向number | nullnull
minnullnull
maxnullnull
stepnumber1
sizeInputNumberSize"default"
placeholderstring""
inputIdstring | nullnull
ariaLabel

The field's accessible name, when no `<label for>` names it.

string | nullnull
disabledbooleanfalse
invalidbooleanfalse
decrementLabel—$localize`:Button that lowers a number field by one step:Decrease`
incrementLabel—$localize`:Button that raises a number field by one step:Increase`