React EasyUI 数字框

2020-06-24 12:07 更新

数字框( NumberBox )用于让用户仅能输入数字值。 数字框( NumberBox )可以把输入的元素转换为不同的输入。

属性列表

名称 数据类型 作用描述 默认值
value number 字段值。 null
min number 最小允许值。 null
max number 最大允许值。 null
increment number 单击微调按钮时增加值。 1
precision number 小数点分隔符后显示的最大精度。 0
decimalSeparator string 小数字符将整数和小数分开。
groupSeparator string 分隔整数组按千百万字符显示。
prefix string 前缀字符串。
suffix string 后缀字符串。

注:
- 继承: SpinnerBase 。

使用方法

<div style={{ marginBottom: 10 }}>
  <Label htmlFor="n1" align="top">Amount:</Label>
  <NumberBox inputId="n1" value={100} spinners></NumberBox>
</div>
<div style={{ marginBottom: 10 }}>
  <Label htmlFor="n2" align="top">List Price:</Label>
  <NumberBox inputId="n2" value={234.56} precision={2} spinners={false}></NumberBox>
</div>
<div style={{ marginBottom: 10 }}>
  <Label htmlFor="n3" align="top">Discount:</Label>
  <NumberBox inputId="n3" value={60} suffix="%" spinners={false}></NumberBox>
</div>
以上内容是否对您有帮助:
在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号