amis2/docs/components/form/hidden.md

39 lines
829 B
Markdown
Raw Normal View History

2020-07-28 10:03:53 +08:00
---
title: Hidden 隐藏字段
2020-07-29 16:20:21 +08:00
description:
2020-07-28 10:03:53 +08:00
type: 0
group: null
menuName: Hidden 隐藏字段
2020-07-29 16:20:21 +08:00
icon:
2020-07-28 10:03:53 +08:00
order: 26
---
## 基本用法
2020-07-29 16:20:21 +08:00
默认表单提交,在没有 [自定义 API 请求数据](../../types/api#%E9%85%8D%E7%BD%AE%E8%AF%B7%E6%B1%82%E6%95%B0%E6%8D%AE) 的情况下,只会发送 `controls` 里面的这些成员,对于隐藏的字段同时又希望提交表单的时候带过去,可以使用 `hidden` 组件
2020-07-28 10:03:53 +08:00
```schema:height="400" scope="body"
{
"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": "邮箱:"
}
]
}
```