前端项目实战叁佰捌拾贰react-admin和material ui-notify消息提示useNotify();

本文讲述了如何在JavaScript中使用useNotify库进行数据创建,包括异步操作的成功回调(onSuccess)和错误处理(onError),展示了在前端技术中处理数据插入的常见实践。
摘要由CSDN通过智能技术生成
  const notify = useNotify()
  if (result !== undefined) {
            create('t_prod_step',
                {
                    data: {
                        machine_type_id: result.machine_type_id, part_id: result.part_id,
                        step_level_id: result.step_level_id, proc_solution_id: result.proc_solution_id, step_desc: result.step_desc,
                        step_no: result.step_no, stand_price: priceRef.current, stand_time: timeRef.current,
                    }
                }, {
                onSuccess: () => {
                    refresh();
                },
                onError: (error) => {
                    notify('插入错误', { type: 'error' });
                }
            }
            );
        }

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值