Browse Source

fix onVisible again (#2134)

pull/2146/head
afc163 9 years ago
parent
commit
151dc957a8
  1. 2
      components/tooltip/demo/basic.md
  2. 4
      components/tooltip/index.jsx

2
components/tooltip/demo/basic.md

@ -9,7 +9,7 @@ title: 基本
import { Tooltip } from 'antd'; import { Tooltip } from 'antd';
ReactDOM.render( ReactDOM.render(
<Tooltip title="提示文字" onVisibleChange={visible => console.log(visible)}> <Tooltip title="提示文字">
<span>鼠标移上来就会出现提示</span> <span>鼠标移上来就会出现提示</span>
</Tooltip> </Tooltip>
, mountNode); , mountNode);

4
components/tooltip/index.jsx

@ -78,14 +78,14 @@ export default class Tooltip extends React.Component {
? `${children.props.className} ${openClassName}` : openClassName; ? `${children.props.className} ${openClassName}` : openClassName;
return ( return (
<RcTooltip <RcTooltip
{...this.props}
transitionName={transitionName} transitionName={transitionName}
builtinPlacements={placements} builtinPlacements={placements}
overlay={title} overlay={title}
visible={visible} visible={visible}
onVisibleChange={this.onVisibleChange}
onPopupAlign={this.onPopupAlign} onPopupAlign={this.onPopupAlign}
ref="tooltip" ref="tooltip"
{...this.props}
onVisibleChange={this.onVisibleChange}
> >
{visible ? cloneElement(children, { className: childrenCls }) : children} {visible ? cloneElement(children, { className: childrenCls }) : children}
</RcTooltip> </RcTooltip>

Loading…
Cancel
Save