ant-design/components/mention/demo/multilines.md

35 lines
529 B
Markdown
Raw Normal View History

2016-07-04 10:31:27 +08:00
---
order: 5
2016-09-23 10:14:57 +08:00
title:
zh-CN: 多行
en-US: Multi-lines Mode
2016-07-04 10:31:27 +08:00
---
## zh-CN
多行模式,多行模式必须指定高度。
## en-US
Multi lines mode.
2017-02-13 10:55:53 +08:00
````jsx
2016-07-04 10:31:27 +08:00
import { Mention } from 'antd';
2018-06-27 15:55:04 +08:00
2016-07-19 12:31:03 +08:00
const { toString } = Mention;
2016-07-04 10:31:27 +08:00
2016-07-19 12:31:03 +08:00
function onChange(editorState) {
console.log(toString(editorState));
2016-07-04 10:31:27 +08:00
}
ReactDOM.render(
<Mention
style={{ width: '100%', height: 100 }}
2016-07-04 10:31:27 +08:00
onChange={onChange}
2018-12-18 18:32:21 +08:00
defaultSuggestions={['afc163', 'benjycui', 'yiminghe', 'jljsj33', 'dqaria', 'RaoHai']}
2016-07-04 10:31:27 +08:00
multiLines
2018-06-27 15:55:04 +08:00
/>,
2018-11-28 15:00:03 +08:00
mountNode
);
2016-07-04 10:31:27 +08:00
````