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 b351962 commit dedd9a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/date-picker/DatePicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { subtractMonth, addMonth, extractTimeObj, covertToDate } from '../_commo
import props from './props';
import TSelectInput from '../select-input';
import TSinglePanel from './panel/SinglePanel';
import { useReadonly } from '../hooks/useReadonly';

import type { TdDatePickerProps } from './type';
import type { DateValue } from './type';
Expand Down Expand Up @@ -44,6 +45,7 @@ export default defineComponent({
const disabled = useDisabled();
const renderTNodeJSX = useTNodeJSX();
const { globalConfig } = useConfig('datePicker');
const isReadOnly = useReadonly();

const formatRef = computed(() =>
getDefaultFormat({
Expand Down Expand Up @@ -292,7 +294,7 @@ export default defineComponent({
popupProps={popupProps.value}
inputProps={inputProps.value}
placeholder={props.placeholder || globalConfig.value.placeholder[props.mode]}
popupVisible={!props.readonly && popupVisible.value}
popupVisible={!isReadOnly && popupVisible.value}
valueDisplay={() => renderTNodeJSX('valueDisplay', { params: valueDisplayParams.value })}
needConfirm={props.needConfirm}
{...(props.selectInputProps as TdDatePickerProps['selectInputProps'])}
Expand Down

0 comments on commit dedd9a8

Please sign in to comment.