Skip to content

Commit

Permalink
[Table] Some Event Params Features (#706)
Browse files Browse the repository at this point in the history
* docs(notification): 插件调用与函数式调用

* fix(table): merged cells border style

* fix(table): pagination

* fix(table): add default width for table-layout: auto

* fix(table): support ellipsis for safari browser

* fix(table): add rowKey validate

* fix(table): improve ellipsis

* feat(table): toggleExpandData

* fix(table): rowValue could be 0

* docs(table): update documents

* fix(table): dragSort rowKey

* fix(table): 去掉非必要的 col width

* fix(table): selectedRowKeys

* feat: update common & update docs

* fix(table): rowClass

* docs: deprecated map-props

* refactor(table): code improve

* feat(table): add event params

* refactor(table): drag-sort

* feat(table): remove dragSort=drag-col

* feat(table): 全局配置

* docs(config-provider): 添加全局配置示例

* feat(config-provider): update docs

* feat(table): 无内置按钮场景下的列配置

* fix(table): rowClassName

* refactor(table): 整理懒加载代码

* feat: update common

* feat: update common

Co-authored-by: sheepluo <sheepluo@tencent.com>
  • Loading branch information
chaishi and sheepluo committed Apr 6, 2022
1 parent 43dc9e3 commit c71cc78
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 c71cc78

Please sign in to comment.