Skip to content

Commit

Permalink
chore: fix typo and desc (#3388)
Browse files Browse the repository at this point in the history
* chore: fix typo

* chore: fix descriptions
  • Loading branch information
uyarn authored Nov 8, 2024
1 parent 90312c8 commit 9714cbc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/date-picker/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ borderless | Boolean | false | 无边框模式 | N
clearable | Boolean | false | 是否显示清除按钮 | N
defaultTime | String | '00:00:00' | 时间选择器默认值,当 value/defaultValue 未设置值时有效 | N
disableDate | Object / Array / Function | - | 禁用日期,示例:['A', 'B'] 表示日期 A 和日期 B 会被禁用。`{ from: 'A', to: 'B' }` 表示在 A 到 B 之间的日期会被禁用。`{ before: 'A', after: 'B' }` 表示在 A 之前和在 B 之后的日期都会被禁用。其中 A = '2021-01-01',B = '2021-02-01'。值类型为 Function 则表示返回值为 true 的日期会被禁用。TS 类型:`DisableDate` `type DisableDate = Array<DateValue> \| DisableDateObj \| ((date: DateValue) => boolean)` `interface DisableDateObj { from?: string; to?: string; before?: string; after?: string }`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/date-picker/type.ts) | N
disableTime | Function | - | 禁用时间项的配置函数。TS 类型:`(time: Date) => Partial<{ hour: Array<number>, minute: Array<number>, second: Array<number>, millisecond: Array<number> }>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/date-picker/type.ts) | N
disableTime | Function | - | 禁用时间项的配置函数,仅在日期时间选择器中可用。TS 类型:`(time: Date) => Partial<{ hour: Array<number>, minute: Array<number>, second: Array<number>, millisecond: Array<number> }>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/date-picker/type.ts) | N
disabled | Boolean | - | 是否禁用组件 | N
enableTimePicker | Boolean | false | 是否显示时间选择 | N
firstDayOfWeek | Number | 7 | 第一天从星期几开始。可选项:1/2/3/4/5/6/7 | N
Expand Down Expand Up @@ -61,7 +61,7 @@ borderless | Boolean | false | 无边框模式 | N
clearable | Boolean | false | 是否显示清除按钮 | N
defaultTime | Array | ["00:00:00", "23:59:59"] | 时间选择器默认值,当 value/defaultValue 未设置值时有效。TS 类型:`string[]` | N
disableDate | Object / Array / Function | - | 禁用日期,示例:['A', 'B'] 表示日期 A 和日期 B 会被禁用。{ from: 'A', to: 'B' } 表示在 A 到 B 之间的日期会被禁用。{ before: 'A', after: 'B' } 表示在 A 之前和在 B 之后的日期都会被禁用。其中 A = '2021-01-01',B = '2021-02-01'。值类型为 Function 则表示返回值为 true 的日期会被禁用。TS 类型:`DisableRangeDate` `type DisableRangeDate = Array<DateValue> \| DisableDateObj \| ((context: { date: DateRangeValue; partial: DateRangePickerPartial }) => boolean)` `interface DisableDateObj { from?: string; to?: string; before?: string; after?: string }` `type DateRangePickerPartial = 'start' \| 'end'`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/date-picker/type.ts) | N
disableTime | Function | - | 禁用时间项的配置函数。TS 类型:`(times: [Date \| null, Date \| null], context: { partial: DateRangePickerPartial }) => Partial<{ hour: Array<number>, minute: Array<number>, second: Array<number> }>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/date-picker/type.ts) | N
disableTime | Function | - | 禁用时间项的配置函数,仅在日期区间选择器中开启时间展示时可用。TS 类型:`(times: [Date \| null, Date \| null], context: { partial: DateRangePickerPartial }) => Partial<{ hour: Array<number>, minute: Array<number>, second: Array<number> }>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/date-picker/type.ts) | N
disabled | Boolean | - | 是否禁用组件 | N
enableTimePicker | Boolean | false | 是否显示时间选择 | N
firstDayOfWeek | Number | - | 第一天从星期几开始。可选项:1/2/3/4/5/6/7 | N
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/date-range-picker-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
disableDate: {
type: [Object, Array, Function] as PropType<TdDateRangePickerProps['disableDate']>,
},
/** 禁用时间项的配置函数 */
/** 禁用时间项的配置函数,仅在日期区间选择器中开启时间展示时可用 */
disableTime: {
type: Function as PropType<TdDateRangePickerProps['disableTime']>,
},
Expand Down
2 changes: 1 addition & 1 deletion src/date-picker/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
disableDate: {
type: [Object, Array, Function] as PropType<TdDatePickerProps['disableDate']>,
},
/** 禁用时间项的配置函数 */
/** 禁用时间项的配置函数,仅在日期时间选择器中可用 */
disableTime: {
type: Function as PropType<TdDatePickerProps['disableTime']>,
},
Expand Down
2 changes: 1 addition & 1 deletion src/switch/props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TdSwitchProps } from './type';
import { PropType } from 'vue';

export default {
/** Switch 切换状态前的回调方法,常用于需要发起异步请求的场景,回到返回值支持布尔和 Promise 类型,返回`false`或 Promise reject不继续执行change,否则则继续执行。 */
/** Switch 切换状态前的回调方法,常用于需要发起异步请求的场景,回调返回值支持布尔和 Promise 类型,返回`false`或 Promise reject不继续执行change,否则则继续执行。 */
beforeChange: {
type: Function as PropType<TdSwitchProps['beforeChange']>,
},
Expand Down
2 changes: 1 addition & 1 deletion src/switch/switch.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

名称 | 类型 | 默认值 | 说明 | 必传
-- | -- | -- | -- | --
beforeChange | Function | - | Switch 切换状态前的回调方法,常用于需要发起异步请求的场景,回到返回值支持布尔和 Promise 类型,返回`false`或 Promise reject不继续执行change,否则则继续执行。TS 类型:`() => boolean \| Promise<boolean>` | N
beforeChange | Function | - | Switch 切换状态前的回调方法,常用于需要发起异步请求的场景,回调返回值支持布尔和 Promise 类型,返回`false`或 Promise reject不继续执行change,否则则继续执行。TS 类型:`() => boolean \| Promise<boolean>` | N
customValue | Array | - | 用于自定义开关的值,[打开时的值,关闭时的值]。默认为 [true, false]。示例:[1, 0]['open', 'close']。TS 类型:`Array<SwitchValue>` | N
disabled | Boolean | - | 是否禁用组件 | N
label | Array / Slot / Function | [] | 开关内容,[开启时内容,关闭时内容]。示例:['开', '关'] 或 (value) => value ? '开' : '关'。TS 类型:`Array<string \| TNode> \| TNode<{ value: SwitchValue }>`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
Expand Down
2 changes: 1 addition & 1 deletion src/switch/type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { TNode } from '../common';

export interface TdSwitchProps {
/**
* Switch 切换状态前的回调方法,常用于需要发起异步请求的场景,回到返回值支持布尔和 Promise 类型,返回`false`或 Promise reject不继续执行change,否则则继续执行。
* Switch 切换状态前的回调方法,常用于需要发起异步请求的场景,回调返回值支持布尔和 Promise 类型,返回`false`或 Promise reject不继续执行change,否则则继续执行。
*/
beforeChange?: () => boolean | Promise<boolean>;
/**
Expand Down

0 comments on commit 9714cbc

Please sign in to comment.