amis/docs/components/form/hidden.md
2020-07-28 10:03:53 +08:00

830 B
Executable File

title description type group menuName icon order
Hidden 隐藏字段 0 null Hidden 隐藏字段 26

基本用法

默认表单提交,在没有 自定义API请求数据 的情况下,只会发送 controls 里面的这些成员,对于隐藏的字段同时又希望提交表单的时候带过去,可以使用 hidden 组件

{
  "type": "form",
  "api": "https://houtai.baidu.com/api/mock2/form/saveForm",
  "debug": true,
  "controls": [
    {
      "type": "hidden",
      "name": "id",
      "value": 1
    },
    {
      "type": "text",
      "name": "name",
      "label": "姓名:"
    },
    {
      "name": "email",
      "type": "email",
      "label": "邮箱:"
    }
  ]
}