antd form 自定义验证表单使用方法
import React from 'react'; import classNames from 'classnames'; export default class FormClass extends React.Component { validateStyle(name) { const {getFieldError, isFieldValidating, getFieldsValue} = this.props.form; const classes = classNames({ 'error': getFieldError(name), 'validating': isFieldValidating(name), 'success': getFieldsValue([name])[name] && !getFieldError(name) && !isFieldValidating(name), }); return classes; } validateHelp(name) { const {getFieldError} = this.props.form; return getFieldError(name) && getFieldError(name).join(', '); } validateFields(cb) { this.props.form.validateFields(cb); } }
npm包
styled-components
react-intl-universal
react-css-modules
cookie
arale-cookie