baidu / baidu/amis

select 级联模式( "selectMode": "chained")下 返回选中的值为Object,应该为String

Open
#3,402 0 comments 0 reactions 0 assignees View on GitHub
need confirm
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

select 级联模式( "selectMode": "chained")下 返回选中的值为Object,应该为String

#### 截图或视频:

[官方例子即是如此](https://baidu.gitee.io/amis/zh-CN/components/form/select#%E7%BA%A7%E8%81%94%E9%80%89%E6%8B%A9)
https://baidu.gitee.io/amis/zh-CN/components/form/select#%E7%BA%A7%E8%81%94%E9%80%89%E6%8B%A9
![](https://i.bmp.ovh/imgs/2022/01/78e120b0baa29c96.png)

现在即使值字段为”value“,也需要配合valueField使用才可以起作用

`{
"type": "page",
"body": [
{
"type": "form",
"api": "https://3xsw4ap8wah59.cfc-execute.bj.baidubce.com/api/amis-mock/mock2/form/saveForm",
"body": [
{
"label": "级联选择",
"type": "select",
"name": "a",
"selectMode": "chained",
"options": [
{
"label": "法师",
"children": [
{
"label": "诸葛亮",
"value": "zhugeliang"
}
]
},
{
"label": "战士",
"children": [
{
"label": "曹操",
"value": "caocao"
},
{
"label": "钟无艳",
"value": "zhongwuyan"
}
]
},
{
"label": "打野",
"children": [
{
"label": "李白",
"value": "libai"
},
{
"label": "韩信",
"value": "hanxin"
},
{
"label": "云中君",
"value": "yunzhongjun"
}
]
}
],
"autoFill": {
"c": "${value}",
"d": "${label}"
},
"valueField": "0"
}
],
"debug": true
}
],
"data": {
"b": "",
"c": "",
"d": ""
}
}`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the select component's `selectMode: "chained"` behavior using the configuration and official select documentation linked in the issue. Reproduce the selected-value output with `valueField: "0"`, then trace how the chained selection is serialized. Done means the selected value is returned as a string while the documented cascading example continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.