Skip to content

Commit 9eb5e38

Browse files
xiaojueshiuyarn
andauthored
fix(DatePicker): 修复 clearable 在 readonly 状态下应为不可用 (#5303)
* feat(form): the Readonly attribute of Form is added for the form read-only function * style(form): 补充 useFormReadonly 函数注释 * feat(input): input 组件的 readonly 属性更改为使用 useFormReadonly 函数获取 input 组件的 readonly 属性更改为使用 useFormReadonly 函数获取,以适配 Form 组件的 readonly 属性 * feat(checkbox): 修改 readonly 属性值的获取方式 修改 readonly 属性值的获取方式,以适配 Form 组件的 readonly 属性 * feat(checkbox): group 组件增加只读属性 * chore: update snapshot * feat(checkbox): 去除 checkbox 无用的 beforeReadonly 判断 * feat(input): 替换 Input readonly 取值方式,将 useFormReadonly 改为 useDisabled 取值,并添加 readonly 默认值 undefined * chore: optimize desc * chore: docs order * fix(DatePicker): 修复清除功能在只读状态下的行为 * refactor(DatePicker): 重构只读状态下的清除功能和只读属性的处理 --------- Co-authored-by: wū yāng <[email protected]>
1 parent e2b92be commit 9eb5e38

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/components/date-picker/DatePicker.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { defineComponent, computed, watch } from 'vue';
22
import dayjs from 'dayjs';
3-
import { isFunction } from 'lodash-es';
3+
import { isFunction, isDate } from 'lodash-es';
44
import { CalendarIcon as TdCalendarIcon } from 'tdesign-icons-vue-next';
55

66
import { useTNodeJSX } from '../hooks/tnode';
@@ -17,7 +17,6 @@ import { useReadonly } from '../hooks/useReadonly';
1717

1818
import type { TdDatePickerProps, DateMultipleValue, DateValue } from './type';
1919
import type { TagInputRemoveContext } from '../tag-input';
20-
import { isDate } from 'lodash-es';
2120

2221
export default defineComponent({
2322
name: 'TDatePicker',
@@ -352,6 +351,7 @@ export default defineComponent({
352351
status={props.status}
353352
tips={props.tips}
354353
clearable={props.clearable}
354+
readonly={isReadOnly.value}
355355
multiple={props.multiple}
356356
popupProps={popupProps.value}
357357
inputProps={inputProps.value}

0 commit comments

Comments
 (0)