import React, { useRef, useState } from 'react'; import { connect } from 'react-redux'; import { Spin, Card, Modal, TreeSelect } from 'antd'; import ProForm, { ProFormText, ModalForm, ProFormSwitch, ProFormTreeSelect } from '@ant-design/pro-form'; const ResetPwd = (props) => { const { visible, onVisibleChange, onConfirm } = props; const formRef = useRef(); const onFinish = (values) => { if (onConfirm) { onConfirm(values); } } return ( { const pwd = formRef.current.getFieldValue('password'); if (!value) { callback(); } if (pwd == value) { callback(); } else { callback('两次输入的密码不一致'); } } } ]} /> ) } function mapStateToProps(state) { return {}; } export default connect(mapStateToProps)(ResetPwd);