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
|
|
|
|
2021-01-07 23:35:03 +08:00
|
|
|
```schema: scope="body"
|
2020-07-28 10:03:53 +08:00
|
|
|
{
|
|
|
|
"type": "form",
|
2021-01-19 10:20:09 +08:00
|
|
|
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm",
|
2020-07-28 10:03:53 +08:00
|
|
|
"debug": true,
|
|
|
|
"controls": [
|
|
|
|
{
|
|
|
|
"type": "hidden",
|
|
|
|
"name": "id",
|
|
|
|
"value": 1
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "text",
|
|
|
|
"name": "name",
|
|
|
|
"label": "姓名:"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "email",
|
|
|
|
"type": "email",
|
|
|
|
"label": "邮箱:"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|