index.js:2178警告:失败的值类型:
isRequired值在Select中标记为必需,但其值为undefined。 index.js:2178警告: defaultValue类型失败: defaultValueisRequired在Select中标记为必需,但其值为undefined。
反应16.7
<Form layout="inline">
<Form.Item>
{
getFieldDecorator('select')(
<Select placeholder='choose' style={{ width: 100 }} onChange={this.selectPuzzle}>
{options}
</Select>
)
}
</Form.Item>
</Form>发布于 2019-04-24 04:26:43
根据antd文档,它应该是
{
getFieldDecorator("select", {
rules: [{ required: true, message: "Your message" }]
})(
<Select
placeholder="choose"
style={{ width: 100 }}
onChange={this.selectPuzzle}
>
{options}
</Select>
);
}https://stackoverflow.com/questions/55822297
复制相似问题