Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Tencent/tdesign-vue into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaosansiji committed Apr 7, 2022
2 parents 7e67216 + c71cc78 commit a0db0df
Show file tree
Hide file tree
Showing 44 changed files with 5,094 additions and 2,868 deletions.
14 changes: 7 additions & 7 deletions examples/checkbox/checkbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
checkAll | Boolean | false | 用于标识是否为「全选选项」。单独使用无效,需在 CheckboxGroup 中使用 | N
checked | Boolean | false | 是否选中。支持语法糖 `v-model` | N
defaultChecked | Boolean | false | 是否选中。非受控属性 | N
default | String / Slot / Function | - | 复选框内容,同 label。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
default | String / Slot / Function | - | 多选框内容,同 label。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
disabled | Boolean | undefined | 是否禁用组件 | N
indeterminate | Boolean | false | 是否为半选 | N
label | String / Slot / Function | - | 主文案。TS 类型:`string | TNode`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts) | N
name | String | - | HTML 元素原生属性 | N
readonly | Boolean | false | 组件是否只读 | N
value | String / Number | - | 复选框的值。TS 类型:`string | number` | N
readonly | Boolean | false | 只读状态 | N
value | String / Number | - | 多选框的值。TS 类型:`string | number` | N
onChange | Function | | TS 类型:`(checked: boolean, context: { e: Event }) => void`<br/>值变化时触发 | N

### Checkbox Events
Expand All @@ -31,12 +31,12 @@ disabled | Boolean | false | 是否禁用组件 | N
max | Number | undefined | 支持最多选中的数量 | N
name | String | - | 统一设置内部复选框 HTML 属性 | N
options | Array | [] | 以配置形式设置子元素。示例1:`['北京', '上海']` ,示例2: `[{ label: '全选', checkAll: true }, { label: '上海', value: 'shanghai' }]`。checkAll 值为 true 表示当前选项为「全选选项」。TS 类型:`Array<CheckboxOption>` `type CheckboxOption = string | number | CheckboxOptionObj` `interface CheckboxOptionObj { label?: string | TNode; value?: string | number; disabled?: boolean; name?: string; checkAll?: true }`[通用类型定义](https://github.com/Tencent/tdesign-vue/blob/develop/src/common.ts)[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts) | N
value | Array | undefined | 选中值。支持语法糖 `v-model`。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts) | N
defaultValue | Array | undefined | 选中值。非受控属性。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts) | N
onChange | Function | | TS 类型:`(value: CheckboxGroupValue, context: CheckboxGroupChangeContext) => void`<br/>值变化时触发。`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: Event; current: CheckboxOption | TdCheckboxProps; type: 'check' | 'uncheck' }`<br/> | N
value | Array | [] | 选中值。支持语法糖 `v-model`。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts) | N
defaultValue | Array | [] | 选中值。非受控属性。TS 类型:`CheckboxGroupValue` `type CheckboxGroupValue = Array<string | number>`[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts) | N
onChange | Function | | TS 类型:`(value: CheckboxGroupValue, context: CheckboxGroupChangeContext) => void`<br/>值变化时触发。`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: Event; current: string | number; option: CheckboxOption | TdCheckboxProps; type: 'check' | 'uncheck' }`<br/> | N

### CheckboxGroup Events

名称 | 参数 | 描述
-- | -- | --
change | `(value: CheckboxGroupValue, context: CheckboxGroupChangeContext)` | 值变化时触发。`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: Event; current: CheckboxOption | TdCheckboxProps; type: 'check' | 'uncheck' }`<br/>
change | `(value: CheckboxGroupValue, context: CheckboxGroupChangeContext)` | 值变化时触发。`context.current` 表示当前变化的数据项,如果是全选则为空;`context.type` 表示引起选中数据变化的是选中或是取消选中。[详细类型定义](https://github.com/Tencent/tdesign-vue/tree/develop/src/checkbox/type.ts)。<br/>`interface CheckboxGroupChangeContext { e: Event; current: string | number; option: CheckboxOption | TdCheckboxProps; type: 'check' | 'uncheck' }`<br/>
Loading

0 comments on commit a0db0df

Please sign in to comment.