antd input組件及原生input標籤取消自動顯示歷史記錄

原生input標籤

在輸入input時會提示原來輸入過的內容,還會出現下拉的歷史記錄,禁止這種情況只需在input中加入:
autocomplete=“off”

<input type="text"  autocomplete="off" />

autocomplete 屬性是用來規定輸入字段是否啓用自動完成的功能。

antd Input組件

Form默認開啓 aotuComplete 功能,當submit 時會記錄輸入歷史,
取消自動補充功能,只需在Form 上加autoComplete="off"即可關閉自動提示輸入歷史

<Form autoComplete = "off">
    <Form.Item >
        {getFieldDecorator(‘value‘)(
            <Input/>
        )
    </Form.Item >
    <Button htmlType="submit">提交</Botton>
</Form>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章