From 74565d37f4b54001404133b8a67e00afc0e8f9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=20Cai?= Date: Fri, 6 Dec 2024 17:13:25 +0800 Subject: [PATCH] fix: use global readonly --- src/time-picker/time-picker.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/time-picker/time-picker.tsx b/src/time-picker/time-picker.tsx index 4b2052b800..af21eed792 100755 --- a/src/time-picker/time-picker.tsx +++ b/src/time-picker/time-picker.tsx @@ -17,6 +17,7 @@ import { useDisabled } from '../hooks/useDisabled'; import { useCommonClassName, useConfig, usePrefixClass } from '../hooks/useConfig'; import { useGlobalIcon } from '../hooks/useGlobalIcon'; import { TdTimePickerProps } from './type'; +import { useReadonly } from '../hooks/useReadonly'; dayjs.extend(customParseFormat); @@ -34,6 +35,7 @@ export default defineComponent({ const currentValue = ref(''); const isShowPanel = ref(false); + const isReadonly = useReadonly(); const { value, modelValue } = toRefs(props); const [innerValue, setInnerValue] = useVModel(value, modelValue, props.defaultValue, props.onChange); @@ -110,7 +112,7 @@ export default defineComponent({ class={inputClasses.value} label={props.label} suffixIcon={() => } - popupVisible={!props.readonly && isShowPanel.value} + popupVisible={!isReadonly && isShowPanel.value} onInputChange={handleInputChange} onBlur={handleInputBlur} onPopupVisibleChange={handleShowPopup}