From 9e2149a17f49b0a50fd4dc7b91936a77d6672326 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=9B=BD=E9=92=A6?= Date: Fri, 15 Nov 2024 00:23:15 +0800 Subject: [PATCH] =?UTF-8?q?fix(slider):=20#7928=20a-form=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E7=9A=84disabled=E5=B1=9E=E6=80=A7=E4=B8=BAtrue=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E9=83=A8=E7=9A=84a-slider=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E8=A2=AB=E7=A6=81=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/slider/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/slider/index.tsx b/components/slider/index.tsx index f08c430fe0..314996854c 100644 --- a/components/slider/index.tsx +++ b/components/slider/index.tsx @@ -18,6 +18,7 @@ import useConfigInject from '../config-provider/hooks/useConfigInject'; import SliderTooltip from './SliderTooltip'; import classNames from '../_util/classNames'; import { useInjectFormItemContext } from '../form/FormItemContext'; +import { useInjectDisabled } from '../config-provider/DisabledContext'; import type { FocusEventHandler } from '../_util/EventInterface'; // CSSINJS @@ -118,6 +119,7 @@ const Slider = defineComponent({ const formItemContext = useInjectFormItemContext(); const sliderRef = ref(); + const disabled = useInjectDisabled(); const visibles = ref({}); const toggleTooltipOpen = (index: number, visible: boolean) => { visibles.value[index] = visible; @@ -213,6 +215,7 @@ const Slider = defineComponent({ draggableTrack={draggableTrack} class={cls} ref={sliderRef} + disabled={props.disabled ?? disabled.value} handle={(info: HandleGeneratorInfo) => handleWithTooltip({ tooltipPrefixCls, @@ -235,6 +238,7 @@ const Slider = defineComponent({ step={restProps.step!} class={cls} ref={sliderRef} + disabled={props.disabled ?? disabled.value} handle={(info: HandleGeneratorInfo) => handleWithTooltip({ tooltipPrefixCls,