Skip to content

Commit

Permalink
fix: use global readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
RSS1102 committed Dec 6, 2024
1 parent 5ce46fa commit 74565d3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/time-picker/time-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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);
Expand Down Expand Up @@ -110,7 +112,7 @@ export default defineComponent({
class={inputClasses.value}
label={props.label}
suffixIcon={() => <TimeIcon />}
popupVisible={!props.readonly && isShowPanel.value}
popupVisible={!isReadonly && isShowPanel.value}
onInputChange={handleInputChange}
onBlur={handleInputBlur}
onPopupVisibleChange={handleShowPopup}
Expand Down

0 comments on commit 74565d3

Please sign in to comment.