import { Button, notification } from 'antd';
queryDemanDetail_two = () => {
const openNotificationWithIcon = type => {
switch (type)
{
case 'success':
notification[type]({
message: '修改成功',
description:
'修改成功',
});
break;
case 'error':
notification[type]({
message: '修改失败',
description:
'修改失败',
});
break;
}
};
this.props.dispatch({
type: 'xxx/xxxx',
payload: {
Id: this.state.Id
}
}).then((res) => {
if (res.code == "200") {
openNotificationWithIcon('success')
} else {
openNotificationWithIcon('error')
}
})
}
ant notification的使用
最新推荐文章于 2025-08-29 13:39:08 发布
本文介绍如何使用Ant Design的通知组件实现操作反馈,包括成功和错误提示。通过具体代码示例,展示了如何根据不同的操作结果展示相应的通知信息。
5728

被折叠的 条评论
为什么被折叠?



