Skip to content

Commit

Permalink
fix(Slider): fix styling errors in hidden element
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Sep 25, 2024
1 parent 68b5ca8 commit 561ddb8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/slider/slider.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ref, toRefs, computed, reactive, defineComponent, watch, onMounted } from 'vue';
import isFunction from 'lodash/isFunction';
import { useIntersectionObserver } from '@vueuse/core';
import config from '../config';
import props from './props';
import { useVModel } from '../shared/useVModel';
Expand Down Expand Up @@ -251,7 +252,14 @@ export default defineComponent({
}
};

onMounted(() => {
const { stop } = useIntersectionObserver(rootRef, ([{ isIntersecting }], observerElement) => {
if (isIntersecting) {
stop();
init();
}
});

const init = () => {
getInitialStyle();

if (props.range) {
Expand All @@ -265,7 +273,7 @@ export default defineComponent({
if (props.marks) {
handleMask(props.marks);
}
});
};

const readerMinText = () => {
if (!props.showExtremeValue) {
Expand Down

0 comments on commit 561ddb8

Please sign in to comment.