根据每种条件显示警报
我有几个后端的条件 II希望根据ANTD模式类似的条件打印一个警报,
Modal.confirm({
centered: true,
title:
'Sorry, you cannot create Menu without satisfying the following conditions: \n\n name\n nameclass \n ageover, \n numberclass.',
okText: 'okay',
cancelText: 'cancel',
onOk: () => {
this.props.setForm('');
},
});
但需要显示标题中所需的字段基于后端的数据。喜欢,
res.data = {nameVal:'jan',组:null,numberClass:5,ageover:21}
,
因此需要表现为基于此结果的字段。如果
res.data = {nameVal:'',group:null,numberClass:0,ageover:0}
在这种需要中以模态显示每个条件。如何从res.data中检查每个条件可用性,并根据该要求显示模态警报。如果我们设置了其他需要编写T0O许多概率的情况。
I have several conditions from backend
iI want to print an alert based on the condition in antd modal like,
Modal.confirm({
centered: true,
title:
'Sorry, you cannot create Menu without satisfying the following conditions: \n\n name\n nameclass \n ageover, \n numberclass.',
okText: 'okay',
cancelText: 'cancel',
onOk: () => {
this.props.setForm('');
},
});
But need show the required fields in the title is based on the data from backend. like,
res.data={ nameval: 'jan', group:null, numberclass:5, ageover:21}
so required field to show as based on this result is group. If
res.data={ nameval:'', group:null, numberclass:0, ageover:0}
in this need to show each condition in modal. How to check each condition availability from res.data and show the modal alert baased on that requirment. If we set if else need to write t0o many probabilities.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需回报语句
Just do it in return statement