在使用ReactJS时,我希望使用一个百分比值(%)的输入元素。我想知道是否有办法做到这一点:
谢谢。
发布于 2021-01-18 13:34:59
您可以将"text“类型的问题配置为只接受0到100之间的数字。关于这个问题,有两个备选方案需要确定:
生成的JSON应该如下所示:
{
"pages": [
{
"name": "page1",
"elements": [
{
"type": "text",
"name": "Enter percentage (0-100)",
"validators": [
{
"type": "numeric",
"minValue": 0,
"maxValue": 100
}
],
"inputType": "number",
"min": "0",
"max": "100"
}
]
}
]
}https://stackoverflow.com/questions/65750568
复制相似问题