diff --git a/components/form/FormItem.jsx b/components/form/FormItem.jsx index fcc13d0d06..bfe6cb65d0 100644 --- a/components/form/FormItem.jsx +++ b/components/form/FormItem.jsx @@ -10,6 +10,8 @@ import { initDefaultProps, getComponentFromProp, filterEmpty, getSlotOptions, is import getTransitionProps from '../_util/getTransitionProps' import BaseMixin from '../_util/BaseMixin' import { cloneElement, cloneVNodes } from '../_util/vnode' +import Icon from '../icon' + export const FormItemProps = { id: PropTypes.string, prefixCls: PropTypes.string, @@ -204,9 +206,33 @@ export default { 'is-validating': validateStatus === 'validating', }) } + let iconType = '' + switch (validateStatus) { + case 'success': + iconType = 'check-circle' + break + case 'warning': + iconType = 'exclamation-circle' + break + case 'error': + iconType = 'close-circle' + break + case 'validating': + iconType = 'loading' + break + default: + iconType = '' + break + } + const icon = (props.hasFeedback && iconType) + ?
: null return (