baidu / baidu/amis

NestedSelect 级联选择器提交时,可以将父子节点分成多个字段提交吗

Open
#7,908 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

我想实现类似级联选择器的功能,先选A,再选A下面的B。

看文档现在级联选择器的父子节点在提交时,数据只存在一个字段中。

不同层级的节点能不能拆成多个字段提交,例如:
```json
{
"type": "nested-select",
"name": "nestedSelect",
"label": "级联选择器",
"options": [
{
"label": "A",
"value": "a"
"children": [
{
"label": "B-1",
"value": "b-1"
}
]
},
{
"label": "C",
"value": "c"
}
]
}
```
期望提交的时候的数据是:
```json
{
"A": "a",
"B": "b-1"
}
```

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the NestedSelect documentation and the component's current submission behavior. Trace how parent and child values are serialized, then define how each selected level should map to a separate field. Done means a nested selection submits distinct fields for the selected levels, including the A/B example described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.