antd 的ProFormSelect的初始化值,要使用initialValue来进行赋值

1、value、selectValue、defaultValue 都是不行的,还是会提示信息要必填

<ProFormSelect showSearch  name={formName}
                    options={manufacturersLovOptions}
                    width="md"
                    value={initBrandValue}
                    initialValue={initBrandValue}
                    disabled={isNotEdit}
                    rules={[{ required: true, message: '请输入相关信息'}]}

  2、

<ProFormSelect showSearch  name={formName}
                    options={manufacturersLovOptions}
                    width="md"
                    value={initBrandValue}
                    initialValue={initBrandValue}
                    disabled={isNotEdit}
                    rules={[{ required: true, message: '请输入相关信息'}]}

  

posted @ 2024-07-01 13:49  信铁寒胜  阅读(8)  评论(0编辑  收藏  举报