ant design pro 表單預設值
阿新 • • 發佈:2018-12-18
除錯時免去頻繁輸入值可以設定輸入框預設值,設定initialValue:
<FormItem> {getFieldDecorator('mail', {initialValue: '[email protected]', rules: [ { required: true, message: formatMessage({ id: 'validation.email.required' }), }, { type: 'email', message: formatMessage({ id: 'validation.email.wrong-format' }), }, ], })( <Input size="large" placeholder={formatMessage({ id: 'form.email.placeholder' })} /> )} </FormItem>