import { Form, Input } from 'antd';
import React, { Component } from 'react';
import { thisExpression } from '@babel/types';
class ComponentA extends Component {
constructor(props) {
super(props);
}
/**
*
* @param {} rule
* @param {String} vaule
* @param {Function} callback
*/
checkPsd(rule, value, callback) {
let password2 = this.props.form.getFieldValue('password2');
if (password2 && password2 !== value) {
callback(new Error('两次密码输入不一致'));
} else {
callback();
}
}
checkPsd2(rule, value, callback) {
let password = this.props.form.getFieldValue('password');
if (password && password !== value) {
callback(new Error('两次密码输入不一致'));
} else {
callback();
}
}
render() {
const FormItem = Form.Item;
const { getFieldDecorator
react、antd技术栈 新密码和确认密码相等校验
最新推荐文章于 2024-06-14 11:16:32 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)