amis icon indicating copy to clipboard operation
amis copied to clipboard

Select的options如果有value一致的选项,Label不会显示对应项目的Label

Open chareice opened this issue 6 years ago • 4 comments

image

{
    "type": "page",
    "body": {
        "type": "form",
        "controls": [
            {
                "label": "选项",
                "type": "select",
                "name": "select",
                "options": [
                    {
                        "label": "A",
                        "value": "a"
                    },
                    {
                        "label": "B",
                        "value": "b"
                    },
                    {
                        "label": "C",
                        "value": "c"
                    },
                    {
                        "label": "D",
                        "value": "c"
                    }
                ]
            }
        ]
    }
}

如上C和D选项的value一样,选项就会显示C而不显示D了。实际场景中会有value一样但Label不一样的情况出现。

chareice avatar Sep 11 '20 01:09 chareice

目前每个option 的 value 需要保持唯一

RickCole21 avatar Sep 11 '20 02:09 RickCole21

这个需求还没遇到过呢,请教一下是什么样的使用场景呢?显示详情的时候,是显示C呢?还是显示D呢?

shaokuuipo avatar Sep 11 '20 07:09 shaokuuipo

发送国际短信,选择国际区号,美国和加拿大的国际区号一样,但是无法合并两个条目。

chareice avatar Sep 14 '20 04:09 chareice

value 要不一样,不然没法区分了

nwind avatar Sep 17 '21 14:09 nwind