chore: tooltip type fix (#3242)
parent
04f72ed2cf
commit
2d6b50242c
|
@ -56,7 +56,7 @@ export default defineComponent({
|
|||
},
|
||||
},
|
||||
methods: {
|
||||
handleVisibleChange(visible) {
|
||||
handleVisibleChange(visible: boolean) {
|
||||
if (!hasProp(this, 'visible')) {
|
||||
this.sVisible = this.isNoTitle() ? false : visible;
|
||||
}
|
||||
|
@ -85,7 +85,7 @@ export default defineComponent({
|
|||
// Fix Tooltip won't hide at disabled button
|
||||
// mouse events don't trigger at disabled button in Chrome
|
||||
// https://github.com/react-component/tooltip/issues/18
|
||||
getDisabledCompatibleChildren(ele) {
|
||||
getDisabledCompatibleChildren(ele: any) {
|
||||
if (
|
||||
((typeof ele.type === 'object' &&
|
||||
(ele.type.__ANT_BUTTON === true ||
|
||||
|
@ -143,7 +143,7 @@ export default defineComponent({
|
|||
},
|
||||
|
||||
// 动态设置动画点
|
||||
onPopupAlign(domNode, align) {
|
||||
onPopupAlign(domNode: HTMLElement, align: any) {
|
||||
const placements = this.getPlacements();
|
||||
// 当前返回的位置
|
||||
const placement = Object.keys(placements).filter(
|
||||
|
|
|
@ -12,7 +12,15 @@ const autoAdjustOverflowDisabled = {
|
|||
|
||||
const targetOffset = [0, 0];
|
||||
|
||||
export function getOverflowOptions(autoAdjustOverflow) {
|
||||
interface PlacementsConfig {
|
||||
arrowPointAtCenter: boolean;
|
||||
arrowWidth?: number;
|
||||
verticalArrowShift?: number;
|
||||
horizontalArrowShift?: number;
|
||||
autoAdjustOverflow?: boolean | Object;
|
||||
}
|
||||
|
||||
export function getOverflowOptions(autoAdjustOverflow: boolean | Object) {
|
||||
if (typeof autoAdjustOverflow === 'boolean') {
|
||||
return autoAdjustOverflow ? autoAdjustOverflowEnabled : autoAdjustOverflowDisabled;
|
||||
}
|
||||
|
@ -22,7 +30,7 @@ export function getOverflowOptions(autoAdjustOverflow) {
|
|||
};
|
||||
}
|
||||
|
||||
export default function getPlacements(config) {
|
||||
export default function getPlacements(config: PlacementsConfig) {
|
||||
const {
|
||||
arrowWidth = 5,
|
||||
horizontalArrowShift = 16,
|
||||
|
|
Loading…
Reference in New Issue