diff --git a/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md b/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md index 02fdb4463e45d6b7001d66d36bc06a3675846d98..d2c1a5f51ceeb53e70388548b3c1994b08356b86 100644 --- a/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md +++ b/zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md @@ -27,7 +27,7 @@ ListItem(value?: string) | sticky(deprecated) | [Sticky](#stickydeprecated枚举说明) | 设置ListItem吸顶效果。
默认值:Sticky.None
从API version9开始废弃,推荐使用[List组件sticky属性](ts-container-list.md#属性)。 | | editable(deprecated) | boolean \| [EditMode](#editmodedeprecated枚举说明) | 当前ListItem元素是否可编辑,进入编辑模式后可删除或移动列表项。
从API version9开始废弃。
默认值:false | | selectable8+ | boolean | 当前ListItem元素是否可以被鼠标框选。
**说明:**
外层List容器的鼠标框选开启时,ListItem的框选才生效。
默认值:true | -| swipeAction9+ | {
start?: CustomBuilder \| SwipeActionItem,
end?:CustomBuilder \| SwipeActionItem,
edgeEffect?: [SwipeEdgeEffect](#swipeedgeeffect9枚举说明),
} | 用于设置ListItem的划出组件。
- start: ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。
- end: ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。
- edgeEffect: 滑动效果。
- swipeActionItem: ListItem向右滑动时,item左边的长距离滑动删除选项或向左滑动时,item右边的长距离滑动删除选项(List垂直布局时)。ListItem向上滑动时,item下边的长距离滑动删除选项或向下滑动时,item上边的长距离滑动删除选项(List水平布局时)。
**说明:**
start和end对应的@builder函数中顶层必须是单个组件,不能是if/else、ForEach、LazyForEach语句。 | +| swipeAction9+ | {
start?: CustomBuilder \| [SwipeActionItem](#SwipeActionItem10对象说明),
end?:CustomBuilder \| [SwipeActionItem](#SwipeActionItem10对象说明),
edgeEffect?: [SwipeEdgeEffect](#swipeedgeeffect9枚举说明),
} | 用于设置ListItem的划出组件。
- start: ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。
- end: ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。
- edgeEffect: 滑动效果。
- swipeActionItem: ListItem的长距离滑动删除选项。
**说明:**
start和end对应的@builder函数中顶层必须是单个组件,不能是if/else、ForEach、LazyForEach语句。 | ## Sticky(deprecated)枚举说明 从API version9开始废弃,推荐使用[List组件stickyStyle枚举](ts-container-list.md#stickystyle9枚举说明)。 @@ -52,13 +52,14 @@ ListItem(value?: string) | None | ListItem划动距离不能超过划出组件大小。 | ## SwipeActionItem10+对象说明 +ListItem向右滑动时,item左边的长距离滑动删除选项或向左滑动时,item右边的长距离滑动删除选项(List垂直布局时)。ListItem向上滑动时,item下边的长距离滑动删除选项或向下滑动时,item上边的长距离滑动删除选项(List水平布局时)。 | 名称 | 参数类型 | 必填 | 描述 | | -------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ | -| deleteAreaDistance | [Length](ts-types.md#length) | 否 | 设置组件长距离滑动删除距离阈值
**说明:**
如果没有设置删除距离阈值就不会触发删除。| -| onDelete | () => **void** | 否 | 组件进入长距删除区后删除ListItem时调用。
进入长距删除区后,抬手时触发;或者滑动速度大于初始速度阈值时触发 | -| onEntryDeleteArea | () => **void** | 否 | 在滑动条目进入删除区域时调用,只触发一次,当再次进入时仍触发。 | -| onExitDeleteArea | () => **void** | 否 |当滑动条目退出删除区域时调用,只触发一次,当再次退出时仍触发。 | +| deleteAreaDistance | [Length](ts-types.md#length) | 否 | 设置组件长距离滑动删除距离阈值。
**说明:**
如果没有设置删除距离阈值就不会触发删除。| +| onDelete | () => void | 否 | 组件进入长距删除区后删除ListItem时调用,进入长距删除区后抬手时触发。 | +| onEntryDeleteArea | () => void | 否 | 在滑动条目进入删除区域时调用,只触发一次,当再次进入时仍触发。 | +| onExitDeleteArea | () => void | 否 |当滑动条目退出删除区域时调用,只触发一次,当再次退出时仍触发。 | | builder | CustomBuilder | 否 |当列表项向右或向右滑动(当列表方向为“垂直”时),向下或向下滑动(当列方向为“水平”时)时显示的操作项。 | | useDefaultDeleteAnimation | boolean | 否 |设置是否使用默认的删除动画。 | ## 事件 @@ -212,4 +213,5 @@ struct ListItemExample3 { } } -``` \ No newline at end of file +``` +![listItem](figures/deleteListItem.gif) \ No newline at end of file