modelValue | number | null | null | 当前值。空值是 null。 |
label | string | — | 字段标签,同时作为无障碍名称。 |
description | string | — | 标签下方的说明。 |
placeholder | string | '' | 占位文本。 |
min | number | null | — | 最小值。离开或按 Enter 时,比它小的输入收到这个值。输入过程中先标成无效。 |
max | number | null | — | 最大值。离开或按 Enter 时,比它大的输入收到这个值。输入过程中先标成无效。 |
step | number | null | 1 | 每次增减的步长。 |
hasNumberSteppers | boolean | false | 在输入框末尾显示加、减按钮。这一步不会改变值时,对应按钮置灰。 |
isWheelEnabled | boolean | true | 输入框聚焦时,滚轮是否改变值。页面滚动应该优先的场景把它关掉。 |
isIntegerOnly | boolean | false | 只提交整数。写小数时文字留在框里,离开输入框后丢弃。键盘也切到数字键盘。 |
formatValue | (value: number) => string | — | 未聚焦时显示的文本,例如 (v) => `${v} 件`。聚焦后显示原始数字方便编辑,格式化后的文本通过 aria-valuetext 暴露给读屏。 |
units | string | null | — | 显示在输入框末尾的单位,例如 %。 |
hasClear | boolean | false | 有值时显示清除按钮。提示只说「清除」,读屏名称带字段名。清除后值为 null。把内容删空后离开,只有开了这个按钮才会提交 null,否则回到原值。 |
isDisabled | boolean | false | 是否禁用。 |
disabledMessage | string | — | 禁用原因。与 isDisabled 一起用时,悬停或键盘聚焦会显示提示;输入框通过 aria-disabled 保持可聚焦,不会被移出 Tab 顺序。 |
isReadOnly | boolean | false | 值照常显示、照常提交,但不能编辑。只读时方向键、滚轮、加减按钮全部关闭。和 isDisabled 同时设置时以禁用以准。 |
isOptional | boolean | false | 字段可选。与 isRequired 互斥。 |
isRequired | boolean | false | 字段必填。与 isOptional 互斥。 |
isLabelHidden | boolean | false | 标签只留给读屏,页面上不显示。 |
labelTooltip | string | — | 标签末尾信息图标里的提示文本。 |
labelIcon | Component | — | 标签文字前的图标。也可以用 labelIcon 插槽。 |
startIcon | Component | — | 输入框起始位置的图标。也可以用 icon 插槽。 |
size | 'sm' | 'md' | 'lg' | 'md' | 尺寸。 |
width | number | string | — | 整个字段的宽度,标签和状态说明一起对齐。数字按像素算,字符串原样使用,例如 '100%'。 |
status | 'default' | 'error' | 'warning' | 'success' | { type, message? } | — | 校验状态。对象带 message 时,说明会显示在字段下方。 |
statusVariant | 'attached' | 'detached' | 'tooltip' | 'attached' | 状态说明的呈现方式。'tooltip' 不显示说明框,改为从状态图标里点开。 |
htmlName | string | — | 表单字段名。 |
autoComplete | string | — | 原生 autocomplete 属性。 |
hasAutoFocus | boolean | false | 挂载后自动聚焦输入框。 |
id | string | — | 输入框元素的 id。不传时自动生成。 |
disabled | boolean | false | 等同于 isDisabled。 |
disabledReason | string | — | 等同于 disabledMessage。 |
clearable | boolean | false | 等同于 hasClear。 |
name | string | — | 等同于 htmlName。 |
containerClass | string | object | array | — | 加到字段外壳的 class。没有外壳时不生效,开发环境会警告。在 InputGroup 和横向标签的 FormLayout 里也是这样。 |
containerStyle | StyleValue | — | 加到字段外壳的行内样式。 |
controlClass | string | object | array | — | 加到数字框本体的 class。直接写在组件上的 class 也落在本体,不会警告。 |
controlStyle | StyleValue | — | 加到数字框本体的行内样式。直接写在组件上的 style 也落在本体。 |