Skip to content

Commit d9cd6f2

Browse files
committed
fix: slider tooltip hide error
1 parent 7bc9c78 commit d9cd6f2

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/tooltip/Tooltip.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import abstractTooltipProps from './abstractTooltipProps';
1212
import useConfigInject from '../_util/hooks/useConfigInject';
1313
import getPlacements from './placements';
1414
import firstNotUndefined from '../_util/firstNotUndefined';
15+
import raf from '../_util/raf';
1516
export type { AdjustOverflow, PlacementsConfig } from './placements';
1617

1718
export type TooltipPlacement = typeof placementTypes[number];
@@ -93,13 +94,16 @@ export default defineComponent({
9394
`'defaultVisible' is deprecated, please use 'v-model:visible'`,
9495
);
9596
});
97+
let rafId: any;
9698
watch(
9799
() => props.visible,
98100
val => {
99-
visible.value = !!val;
101+
raf.cancel(rafId);
102+
rafId = raf(() => {
103+
visible.value = !!val;
104+
});
100105
},
101106
);
102-
103107
const isNoTitle = () => {
104108
const title = props.title ?? slots.title;
105109
return !title && title !== 0;

0 commit comments

Comments
 (0)