You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

1.8 KiB

位置

  • order: 1

位置有十二个方向。


import { Popover, Button } from 'antd';

const text = <span>标题</span>;
const content = <div>
  <p>内容</p>
  <p>内容</p>
</div>;

ReactDOM.render(<div>
  <Popover placement="leftTop" title={text} overlay={content} trigger="click">
    <Button>左上</Button>
  </Popover>
  <Popover placement="left" title={text} overlay={content} trigger="click">
    <Button></Button>
  </Popover>
  <Popover placement="leftBottom" title={text} overlay={content} trigger="click">
    <Button>左下</Button>
  </Popover>
  <br/>
  <Popover placement="topLeft" title={text} overlay={content} trigger="click">
    <Button>上左</Button>
  </Popover>
  <Popover placement="top" title={text} overlay={content} trigger="click">
    <Button></Button>
  </Popover>
  <Popover placement="topRight" title={text} overlay={content} trigger="click">
    <Button>上右</Button>
  </Popover>
  <br/>
  <Popover placement="bottomLeft" title={text} overlay={content} trigger="click">
    <Button>下左</Button>
  </Popover>
  <Popover placement="bottom" title={text} overlay={content} trigger="click">
    <Button></Button>
  </Popover>
  <Popover placement="bottomRight" title={text} overlay={content} trigger="click">
    <Button>下右</Button>
  </Popover>
  <br/>
  <Popover placement="rightTop" title={text} overlay={content} trigger="click">
    <Button>右上</Button>
  </Popover>
  <Popover placement="right" title={text} overlay={content} trigger="click">
    <Button></Button>
  </Popover>
  <Popover placement="rightBottom" title={text} overlay={content} trigger="click">
    <Button>右下</Button>
  </Popover>
</div>, document.getElementById('components-popover-demo-placement'));