@@ -78,9 +78,12 @@ export default {
7878 // mouse events don't trigger at disabled button in Chrome
7979 // https://github.com/react-component/tooltip/issues/18
8080 getDisabledCompatibleChildren ( ele ) {
81- const isAntBtn = ele . componentOptions && ele . componentOptions . Ctor . options . __ANT_BUTTON ;
81+ const options = ( ele . componentOptions && ele . componentOptions . Ctor . options ) || { } ;
82+
8283 if (
83- ( isAntBtn &&
84+ ( ( options . __ANT_BUTTON === true ||
85+ options . __ANT_SWITCH === true ||
86+ options . __ANT_CHECKBOX === true ) &&
8487 ( ele . componentOptions . propsData . disabled ||
8588 ele . componentOptions . propsData . disabled === '' ) ) ||
8689 ( ele . tag === 'button' &&
@@ -125,8 +128,16 @@ export default {
125128 } ,
126129
127130 isNoTitle ( ) {
128- const { $slots, title } = this ;
129- return ! $slots . title && ! title ;
131+ const title = getComponentFromProp ( this , 'title' ) ;
132+ return ! title && title !== 0 ;
133+ } ,
134+
135+ getOverlay ( ) {
136+ const title = getComponentFromProp ( this , 'title' ) ;
137+ if ( title === 0 ) {
138+ return title ;
139+ }
140+ return title || '' ;
130141 } ,
131142
132143 // 动态设置动画点
@@ -189,6 +200,7 @@ export default {
189200 prefixCls,
190201 getTooltipContainer : getPopupContainer || getContextPopupContainer ,
191202 builtinPlacements : this . getPlacements ( ) ,
203+ overlay : this . getOverlay ( ) ,
192204 visible : sVisible ,
193205 } ,
194206 ref : 'tooltip' ,
@@ -200,7 +212,6 @@ export default {
200212 } ;
201213 return (
202214 < VcTooltip { ...tooltipProps } >
203- < template slot = "overlay" > { getComponentFromProp ( this , 'title' ) } </ template >
204215 { sVisible ? cloneElement ( child , { class : childCls } ) : child }
205216 </ VcTooltip >
206217 ) ;
0 commit comments