diff --git a/build/config.js b/build/config.js
index 68fd72401..622e99787 100644
--- a/build/config.js
+++ b/build/config.js
@@ -1,5 +1,5 @@
module.exports = {
dev: {
- componentName: 'tag', // dev components
+ componentName: 'tooltip', // dev components
},
};
diff --git a/components/tooltip/Tooltip.jsx b/components/tooltip/Tooltip.jsx
index dcf427622..fe94edd65 100644
--- a/components/tooltip/Tooltip.jsx
+++ b/components/tooltip/Tooltip.jsx
@@ -78,9 +78,12 @@ export default {
// mouse events don't trigger at disabled button in Chrome
// https://github.com/react-component/tooltip/issues/18
getDisabledCompatibleChildren(ele) {
- const isAntBtn = ele.componentOptions && ele.componentOptions.Ctor.options.__ANT_BUTTON;
+ const options = (ele.componentOptions && ele.componentOptions.Ctor.options) || {};
+
if (
- (isAntBtn &&
+ ((options.__ANT_BUTTON === true ||
+ options.__ANT_SWITCH === true ||
+ options.__ANT_CHECKBOX === true) &&
(ele.componentOptions.propsData.disabled ||
ele.componentOptions.propsData.disabled === '')) ||
(ele.tag === 'button' &&
@@ -125,8 +128,16 @@ export default {
},
isNoTitle() {
- const { $slots, title } = this;
- return !$slots.title && !title;
+ const title = getComponentFromProp(this, 'title');
+ return !title && title !== 0;
+ },
+
+ getOverlay() {
+ const title = getComponentFromProp(this, 'title');
+ if (title === 0) {
+ return title;
+ }
+ return title || '';
},
// 动态设置动画点
@@ -189,6 +200,7 @@ export default {
prefixCls,
getTooltipContainer: getPopupContainer || getContextPopupContainer,
builtinPlacements: this.getPlacements(),
+ overlay: this.getOverlay(),
visible: sVisible,
},
ref: 'tooltip',
@@ -200,7 +212,6 @@ export default {
};
return (