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

40 lines
614 B
Markdown
Raw Normal View History

---
order: 0
title:
zh-CN: 向上展开
en-US: Placement
---
## zh-CN
向上展开建议。
## en-US
Change the suggestions placement.
````jsx
import { Mention } from 'antd';
2018-06-27 15:55:04 +08:00
const { toString } = Mention;
function onChange(contentState) {
console.log(toString(contentState));
}
function onSelect(suggestion) {
console.log('onSelect', suggestion);
}
ReactDOM.render(
<Mention
style={{ width: '100%' }}
onChange={onChange}
2018-12-18 18:32:21 +08:00
defaultSuggestions={['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
);
````