antdesign底层弹出个confirmModal.怎么获取底层的this
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了antdesign底层弹出个confirmModal.怎么获取底层的this相关的知识,希望对你有一定的参考价值。
参考技术A //使用箭头函数Modal.confirm(
title: '确认删除编码信息?',
content: '删除编码信息',
okType: 'danger',
onOk: () =>
this.props.updateVinGroupDetail(index, [], this.props.vinApplication);
this.setState(editTableVisible: false);
,
onCancel()
,
); 参考技术B showConfirm() //弹出确认对话框
confirm(
title: '当前总计应收金额为'+this.state.allReceivablePrice+'元',//这里能得到值!!!!
// content: 'some descriptions',
okText: '确认回款',
cancelText: '取消',
onOk()
const allSelectOrder=this.state;
if (allSelectOrder.length==0)
message.error('订单Id不能为空');
return;
else
this.setState(loading: true);
$.ajax(
url: API.flow,
type: 'post',
dataType: 'json',
data: JSON.stringify(allSelectOrder),
contentType: 'application/json;charset=UTF-8',
success: ()=>
this.setState(
loading: false,
);
message.success('添加收款记录成功!');
this.refreshData();
,
error: (data)=>
Modal.error(
title: data.responseJSON.msg
);
this.setState( loading: false );
)
,
onCancel() 本回答被提问者采纳
用java在电脑上简单弹出个提示框
package test; import javax.swing.*; import java.awt.*; /** * @Author: 张学涛 * @Date: 2020-05-25 11:08 * @Version 1.0 */ public class SimpTest { public static void main(String[] args) { SimpleFrame frame = new SimpleFrame("人脸验证警告:"); frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); //显示 frame.setVisible(true); } static class SimpleFrame extends JFrame { private static final int DEFAULT_WIDTH = 240; private static final int DEFAULT_HEIGHT =100; public SimpleFrame(String title){ setSize(DEFAULT_WIDTH,DEFAULT_HEIGHT); setTitle(title); setBackground(Color.red); //设置框体显示在中央 int windowWidth = this.getWidth(); //获得窗口宽 int windowHeight = this.getHeight(); //获得窗口高 Toolkit kit = Toolkit.getDefaultToolkit(); //定义工具包 Dimension screenSize = kit.getScreenSize(); //获取屏幕的尺寸 int screenWidth = screenSize.width; //获取屏幕的宽 int screenHeight = screenSize.height; //获取屏幕的高 this.setLocation(screenWidth/2-windowWidth/2, screenHeight/2-windowHeight/2);//设置窗口居中显示 this.setUndecorated(true); // this.getRootPane().setWindowDecorationStyle(JRootPane.WARNING_DIALOG);//采用指定的窗口装饰风格 this.getRootPane().setWindowDecorationStyle(JRootPane.ERROR_DIALOG);//采用指定的窗口装饰风格 this.setAlwaysOnTop(true); WordPanel wordPanel= new WordPanel(); getContentPane().add(wordPanel); } } static class WordPanel extends JPanel { private static final int POS_X =30; private static final int POS_Y = 40; @Override public void paintComponent(Graphics g) { super.paintComponent(g); setBackground(Color.WHITE); g.drawString("非本人登录",POS_X,POS_Y); setFont(new Font("黑体",1,18)); setForeground(Color.red);//设置字体颜色 } } }
以上是关于antdesign底层弹出个confirmModal.怎么获取底层的this的主要内容,如果未能解决你的问题,请参考以下文章