Skip to content

Commit

Permalink
文档更新
Browse files Browse the repository at this point in the history
  • Loading branch information
hkaikai committed Jul 2, 2024
1 parent 5e9bbca commit 5877929
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 62 deletions.
2 changes: 1 addition & 1 deletion tdesign-component/example/assets/api/drawer_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
| width | double? | 280 | 宽度 |
| drawerTop | double? | - | 距离顶部的距离 |
| style | TDCellStyle? | - | 列表自定义样式 |
| hover | bool? | false | 是否开启点击反馈 |
| hover | bool? | true | 是否开启点击反馈 |

```
```
Expand Down
3 changes: 2 additions & 1 deletion tdesign-component/example/assets/api/dropdown-menu_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| builder | TDDropdownItemBuilder | - | 下拉菜单构建器 |
| builder | TDDropdownItemBuilder? | - | 下拉菜单构建器,优先级高于[items] |
| items | List<TDDropdownItem>? | - | 下拉菜单 |
| closeOnClickOverlay | bool? | true | 是否在点击遮罩层后关闭菜单 |
| direction | TDDropdownMenuDirection? | TDDropdownMenuDirection.auto | 菜单展开方向(down、up、auto) |
| duration | double? | 200.0 | 动画时长,毫秒 |
Expand Down
3 changes: 3 additions & 0 deletions tdesign-component/example/assets/api/popup_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| builder | WidgetBuilder | - | 控件构建器 |
| barrierLabel | | - | |
| modalBarrierColor | Color? | Colors.black54 | 蒙层颜色 |
| isDismissible | bool | true | 点击蒙层能否关闭 |
| modalBarrierFull | bool | false | 是否全屏显示蒙层 |
Expand All @@ -15,6 +16,8 @@
| modalHeight | double? | - | 弹出框高度 |
| modalTop | double? | 0 | 弹出框顶部距离 |
| modalLeft | double? | 0 | 弹出框左侧距离 |
| open | VoidCallback? | - | 打开前事件 |
| opened | VoidCallback? | - | 打开后事件 |

```
```
Expand Down
67 changes: 7 additions & 60 deletions tdesign-component/example/assets/api/swipe-cell_api.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,72 +11,19 @@
| cell | Widget | - | 单元格 [TDCell] |
| disabled | bool? | false | 是否禁用滑动 |
| opened | List<bool>? | const [false, false] | 默认打开,[left, rigth] |
| right | TDSwipePanel? | - | 右侧滑动操作项面板 |
| left | TDSwipePanel? | - | 左侧滑动操作项面板 |
| right | TDSwipeCellPanel? | - | 右侧滑动操作项面板 |
| left | TDSwipeCellPanel? | - | 左侧滑动操作项面板 |
| onChange | Function(TDSwipeDirection direction, bool open)? | - | 滑动展开事件 |
| controller | SlidableController? | - | 自定义控制滑动窗口 |
| groupTag | Object? | - | 同一组中只有一个被打开 |
| groupTag | Object? | - | 同一组中只有一个被打开[TDSwipeCell]必须为[TDSwipeCellClose]的后代组件才有效 |
| closeOnScroll | bool? | true | 滚动时,是否关闭滑动操作项面板 |
| dragStartBehavior | DragStartBehavior? | DragStartBehavior.start | 处理拖动开始行为的方式[GestureDetector.dragStartBehavior] |
| direction | Axis? | Axis.horizontal | 可拖动的方向 |
| duration | Duration? | const Duration(milliseconds: 200) | 打开关闭动画时长 |

```
```
### TDSwipePanel
#### 简介
滑动单元格操作面板组件
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| extentRatio | double? | 0.3 | 宽度占比 |
| openThreshold | double? | - | 拖动多少占比触发打开动作,默认 [extentRatio] 的一半 |
| closeThreshold | double? | - | 拖动多少占比触发关闭动作,默认 [extentRatio] 的一半 |
| motionType | SwipeMotion? | - | 滑动动画展示方式 |
| dragDismissible | bool? | false | 是否可通过拖动操作来移除 [TDSwipeCell] 组件 |
| dismissThreshold | double? | 0.75 | 滑动到多少比例时,触发移除。dragDismissible为true才有效 |
| dismissalDuration | Duration? | const Duration(milliseconds: 300) | 触发移除的滑动动画时长。dragDismissible为true才有效 |
| resizeDuration | Duration? | const Duration(milliseconds: 300) | 移除动画(高度变为0)时长。dragDismissible为true才有效 |
| closeOnCancel | bool? | false | 移除取消后,是否关闭滑动单元格。dragDismissible为true才有效 |
| confirmDismiss | dismissible_pane.ConfirmDismissCallback? | - | 移除前回调,可阻止移除。dragDismissible为true才有效 |
| onDismissed | VoidCallback? | - | 移除后回调。dragDismissible为true才有效 |
| children | List<TDSwipeAction> | - | 操作组件列表 |
| confirms | List<TDSwipeAction>? | - | 二次确认操作组件列表 |

```
```
### TDSwipeAction
#### 简介
滑动单元格操作按钮
#### 默认构造方法

| 参数 | 类型 | 默认值 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| flex | int? | 1 | 宽度占比,默认为 1 |
| backgroundColor | Color? | - | 背景颜色 |
| autoClose | bool? | true | 点击后自动关闭 |
| onPressed | VoidCallback? | - | 点击回调 |
| icon | IconData? | - | 图标 |
| iconColor | Color? | - | 图标颜色,默认label字体颜色 |
| iconSize | double? | 18 | 图标大小 |
| spacing | double? | 2 | 图标和标题的间距 |
| label | String? | - | 标题 |
| labelStyle | TextStyle? | - | 标题样式 |
| direction | Axis? | Axis.horizontal | 图标和标题的排列方向 |
| confirmIndex | List<int>? | - | 指定[TDSwipePanel.children]的索引,来打开该[TDSwipeAction] |
| builder | WidgetBuilder? | - | 自定义构建 |

```
```
### TDSwipeAutoClose
#### 简介
滑动单元格自动关闭组件,需要[TDSwipeCell]组件配置相同的[TDSwipeCell.groupTag]
#### 默认构造方法
#### 静态方法

| 参数 | 类型 | 默认值 | 说明 |
| 名称 | 返回类型 | 参数 | 说明 |
| --- | --- | --- | --- |
| key | | - | |
| closeWhenOpened | bool? | true | 打开[TDSwipeCell]前是否自动关闭其它 |
| closeWhenTapped | bool? | true | 点击[TDSwipeAutoClose]组件时,关闭全部[TDSwipeCell] |
| child | Widget | - | 其后代必须有[TDSwipeCell] |
| of | | required BuildContext context, | |

0 comments on commit 5877929

Please sign in to comment.