Skip to content
On this page

数字输入组件

NInputNumber

TIP

NInputNumber 同 antdv InputNumber 组件的二次封装, 同 antdv InputNumber 组件的所有参数/事件/方法/插槽外, 还支持以下参数.

Props
参数说明类型可选值默认值必填
... 同 antdv InputNumber 组件的所有参数............
round设置了精度时, 是否四舍五入boolean-true×
precisionRange动态精度, 用于设置精度的最大值和最小值. 当 precision 存在时, 该参数无效[number, number]--×

示例

javascript
import { ref } from "vue";

const value = ref(1.99999);
const round = ref(true);
html
<div>
  <a-form-item label="四舍五入">
    <a-switch v-model:checked="round"></a-switch>
  </a-form-item>
  <n-input-number v-model:value="value" :precision-range="[2, 6]" :round="round" />
</div>