在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問答/HTML/ antd里input組件的autosize屬性寫法

antd里input組件的autosize屬性寫法

如果這樣寫<Input type="textarea" placeholder="不能超過50字" maxLength={50} autosize />,會報錯Received true for a non-boolean attribute autosize;

如果這樣寫<Input type="textarea" placeholder="不能超過50字" maxLength={50} autosize={true} />,也會報錯Received true for a non-boolean attribute autosize;

如果這樣寫<Input type="textarea" placeholder="不能超過50字" maxLength={50} autosize='true' />,會報錯Failed prop type: Invalid prop autosize supplied to Input.

autosize屬性應(yīng)該是怎么寫呢,官網(wǎng)api寫的是autosize

回答
編輯回答
舊言
2018年3月19日 14:35
編輯回答
初念

antd案例是這么寫的,不是設(shè)置type="textarea",而是用<TextArea autosize/>

import { Input } from 'antd';
const { TextArea } = Input;

ReactDOM.render(
  <div>
    <TextArea placeholder="Autosize height based on content lines" autosize />
    <div style={{ margin: '24px 0' }} />
    <TextArea placeholder="Autosize height with minimum and maximum number of lines" autosize={{ minRows: 2, maxRows: 6 }} />
  </div>
, mountNode);
2018年2月10日 12:23
編輯回答
殘淚

直接,< Input.TextArea />

2017年12月2日 22:29