您可以将value的值改为字符串'<=100',这样在选中库存<=100时会传递quantity=<=100给后端。修改后的代码如下:

{
  "label": "库存数量",
  "field": "quantity",
  "component": "Select",
  "defaultValue": null,
  "componentProps": {
    "options": [
      {
        "label": "库存 <= 100",
        "value": "<=100",
        "key": "1"
      },
      {
        "label": "库存为0",
        "value": "0",
        "key": "2"
      }
    ]
  }
}

请注意,这里的value是字符串类型的'<=100',而不是数值类型的<=100。这样在向后端传参时,quantity的值将会是%3C%3D100

label 库存数量 field quantity component Select defaultValue null componentProps options label 库存 = 100 value =100 key 1 label 库存为0 value 0 key 2 当选中库存=100时报错1 errors Field error in object yfStock

原文地址: http://www.cveoy.top/t/topic/iLYN 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录