0

我正在使用 react json 模式表单来创建表单。我正在尝试提交表格。当我发送空值时。密钥从数据中消除。例如在一个表单中,我有两个字段名称和地址。输入名称="abc" 地址=""

输出{名称:abc}

所需的输出{名称:abc,地址:}

4

1 回答 1

1

您可以使用默认值。尝试

{
  "title": "A registration form",
  "description": "A simple form example.",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "title": "name",
      "default": ""
    },
    "address": {
      "type": "string",
      "title": "address",
      "default": ""
    }
  }
}
于 2019-10-09T02:10:43.837 回答