日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

antd form操作表單元素以及獲取值方法,antd form獲取某個值

作者:有問題請評論我改 更新時間: 2022-04-05 編程語言
        <FormItem>
          {getFieldDecorator('ticket', {
            rules: [{ required: true, message: '驗證碼不能為空' }],
          })(
            <Input
              autoComplete="off"
            />}
             placeholder="驗證碼"
            />,
          )}
        </FormItem>

重置表單值至initialValue

     const { resetFields } = this.props && this.props.form             
     resetFields(['ticket']

獲取表單元素值

    const { getFieldValue } = this.props.form
    let ticket = getFieldValue('ticket')

設置表單元素的值

 const { setFieldsValue } =  this.props.form
 setFieldsValue({ ticket: '222' })

antd柵格行與列的基本使用


import { Input, Button, Row, Col } from 'antd'
      const item ={
        label: '博客地址:',
        url: `https://blog.csdn.net/qq_26889291?spm=1011.2124.3001.5343`,
      }
      function renderItem(){
       return(
               <Row type="flex" gutter={[0, 50]} justify="center" align="middle">
                <Col span={3}   offset={1} >{item.label}</Col>
                <Col span={15}><Input value={item.url} id={inputIdArr[index]} /></Col>
                <Col span={4} offset={1}><Button type="primary">復制</Button></Col>
              </Row>
       )

}

原文鏈接:https://blog.csdn.net/qq_26889291/article/details/122918542

欄目分類
最近更新