diff --git a/components/popover/demo/basic.md b/components/popover/demo/basic.md index c82a51308a..7f89a7611f 100644 --- a/components/popover/demo/basic.md +++ b/components/popover/demo/basic.md @@ -16,7 +16,7 @@ const content = ( ); ReactDOM.render( - + , mountNode); diff --git a/components/popover/demo/control.md b/components/popover/demo/control.md index e455cee10b..bf49b54f70 100644 --- a/components/popover/demo/control.md +++ b/components/popover/demo/control.md @@ -29,7 +29,7 @@ const App = React.createClass({ ); return ( - diff --git a/components/popover/demo/placement.md b/components/popover/demo/placement.md index 20c1976ebc..24b474a85f 100644 --- a/components/popover/demo/placement.md +++ b/components/popover/demo/placement.md @@ -19,46 +19,46 @@ const content = ( ReactDOM.render(
- + - + - +
- + - + - +
- + - + - +
- + - + - +
diff --git a/components/popover/demo/triggerType.md b/components/popover/demo/triggerType.md index 1b76772a56..e8abd85673 100644 --- a/components/popover/demo/triggerType.md +++ b/components/popover/demo/triggerType.md @@ -17,13 +17,13 @@ const content = ( ReactDOM.render(
- + - + - +
diff --git a/components/popover/index.jsx b/components/popover/index.jsx index abf4e7c852..273ef1326f 100644 --- a/components/popover/index.jsx +++ b/components/popover/index.jsx @@ -1,6 +1,7 @@ import React from 'react'; import Tooltip from 'rc-tooltip'; import getPlacements from './placements'; +import warning from 'warning'; const placements = getPlacements(); @@ -45,13 +46,22 @@ export default class Popover extends React.Component { return this.refs.tooltip.getPopupDomNode(); } + componentDidMount() { + if ('overlay' in this.props) { + warning(false, '`overlay` prop of Popover is deperated, use `content` instead.'); + } + } + getOverlay() { - const { title, prefixCls, overlay } = this.props; + // use content replace overlay + // keep overlay for compatibility + const { title, prefixCls, overlay, content } = this.props; + return (
{title &&
{title}
}
- {overlay} + {content || overlay}
); diff --git a/components/popover/index.md b/components/popover/index.md index 4ccef1f014..f4a094f8bf 100644 --- a/components/popover/index.md +++ b/components/popover/index.md @@ -20,7 +20,7 @@ english: Popover | trigger | 触发行为,可选 `hover/focus/click` | string | hover | | placement | 气泡框位置,可选 `top/left/right/bottom` `topLeft/topRight/bottomLeft/bottomRight` `leftTop/leftBottom/rightTop/rightBottom` | string | top | | title | 卡片标题 | React.Element | 无 | -| overlay | 卡片内容 | React.Element | 无 | +| content | 卡片内容 | React.Element | 无 | | overlayClassName | 卡片类名 | string | 无 | | overlayStyle | 卡片样式 | object | 无 | | visible | 用于手动控制浮层显隐 | boolean | false |