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}
|
2018-12-18 18:32:21 +08:00
|
|
|
defaultSuggestions={['afc163', 'benjycui', 'yiminghe', 'RaoHai', '中文', 'にほんご']}
|
2017-09-25 21:12:43 +08:00
|
|
|
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
|
|
|
````
|