baidu / baidu/amis

select 组件在 combo 内 指定 labelField 和 valueField 时,第二个下拉框为空

Open
#7,359 1 comment 0 reactions 0 assignees View on GitHub
bug confirmed
Dominant language
TypeScript
Stars
18.9k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

#### 描述问题:

select 组件在 combo 内 指定 labelField 和 valueField 时,第二个下拉框为空

#### 截图或视频:
正常场景:
![image](https://github.com/baidu/amis/assets/19227210/9bc40adc-851f-4040-b43c-537a7b3d104c)
异常场景:
![image](https://github.com/baidu/amis/assets/19227210/7b93f1b7-1d2d-4594-bfee-29108c24a488)

#### 如何复现(请务必完整填写下面内容):
1. 你是如何使用 amis 的?
jssdk

2. amis 版本是什么?请先在最新 beta 版本测试问题是否存在
v3.0.0

3. 粘贴有问题的完整 `amis schema` 代码:
**正常配置**
- schema
```
{
"name": "select_combo",
"label": "下拉框demo",
"items": [
{
"name": "select",
"label": "下拉框",
"unique": true,
"source": {
"url": "/api/data"
},
"labelField": "label",
"valueField": "value",
"type": "select"
}
],
"multiple": true,
"type": "combo"
}
```
- /api/data
```
{
"code": 0,
"message": "操作成功",
"data": [
{
"value": "a",
"label": "A"
},
{
"value": "b",
"label": "B"
}
]
}
```

**异常配置**

- schema
```
{
"name": "select_combo",
"label": "下拉框demo",
"items": [
{
"name": "select",
"label": "下拉框",
"unique": true,
"source": {
"url": "/api/data"
},
"labelField": "label1",
"valueField": "value1",
"type": "select"
}
],
"multiple": true,
"type": "combo"
}
```
- /api/data
```
{
"code": 0,
"message": "操作成功",
"data": [
{
"value1": "a",
"label1": "A"
},
{
"value1": "b",
"label1": "B"
}
]
}
```

4. 操作步骤
请简单描述一下复现的操作步骤...

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the select component inside the combo schema shown in the report, using the JS SDK reproduction and its /api/data response as the entry point. Compare the normal label/value configuration with the label1/value1 configuration, then verify that the second dropdown is populated with the returned options and that the existing configuration still works.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.