【发布时间】:2019-10-04 09:58:06
【问题描述】:
我想使用notifications 推送表单反馈,而不是内联消息。例如
<Form.Item label="Name">
{getFieldDecorator("name", {
rules: [
{
validator(rule, value, callback) {
if (!value) {
callback("Enter Your Name");
// I'd like to use this instead:
// notification.open({
// message: "Enter Your Name",
// description:
// 'This is the content of the notification.',
// })
}
callback();
}
}
]
})(<Name />)}
</Form.Item>;
是否可以在没有内联消息的情况下验证表单字段并保持视觉反馈(例如 border-color 更改之类的东西)?
【问题讨论】:
标签: reactjs antd ant-design-pro