2017-09-25 21:12:43 +08:00
|
|
|
---
|
|
|
|
order: 0
|
|
|
|
title:
|
|
|
|
zh-CN: 向上展开
|
2017-09-27 22:32:49 +08:00
|
|
|
en-US: Placement
|
2017-09-25 21:12:43 +08:00
|
|
|
---
|
|
|
|
|
|
|
|
## zh-CN
|
|
|
|
|
|
|
|
向上展开建议。
|
|
|
|
|
|
|
|
## en-US
|
|
|
|
|
2017-09-27 22:32:49 +08:00
|
|
|
Change the suggestions placement.
|
2017-09-25 21:12:43 +08:00
|
|
|
|
|
|
|
````jsx
|
|
|
|
import { Mention } from 'antd';
|
2018-06-27 15:55:04 +08:00
|
|
|
|
2017-09-25 21:12:43 +08:00
|
|
|
const { toString } = Mention;
|
|
|
|
|
|
|
|
function onChange(contentState) {
|
|
|
|
console.log(toString(contentState));
|
|
|
|
}
|
|
|
|
|
|
|
|
function onSelect(suggestion) {
|
|
|
|
console.log('onSelect', suggestion);
|
|
|
|
}
|
|
|
|
|
|
|
|
ReactDOM.render(
|
|
|
|
<Mention
|
2017-09-27 22:32:49 +08:00
|
|
|
style={{ width: '100%' }}
|
2017-09-25 21:12:43 +08:00
|
|
|
onChange={onChange}
|
|
|
|
suggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
|
|
|
onSelect={onSelect}
|
|
|
|
placement="top"
|
2018-06-27 15:55:04 +08:00
|
|
|
/>,
|
2018-11-28 15:00:03 +08:00
|
|
|
mountNode
|
|
|
|
);
|
2017-09-25 21:12:43 +08:00
|
|
|
````
|