未验证 提交 8d4b2494 编写于 作者: L limeng 提交者: Gitee

update zh-cn/application-dev/reference/arkui-ts/ts-container-listitem.md.

Signed-off-by: Nlimeng <limeng208@huawei.com>
上级 c37bd94a
......@@ -27,7 +27,7 @@ ListItem(value?: string)
| sticky<sup>(deprecated)</sup> | [Sticky](#stickydeprecated枚举说明) | 设置ListItem吸顶效果。<br/>默认值:Sticky.None<br/>从API version9开始废弃,推荐使用[List组件sticky属性](ts-container-list.md#属性)。 |
| editable<sup>(deprecated)</sup> | boolean&nbsp;\|&nbsp;[EditMode](#editmodedeprecated枚举说明) | 当前ListItem元素是否可编辑,进入编辑模式后可删除或移动列表项。<br/>从API version9开始废弃。<br/>默认值:false |
| selectable<sup>8+</sup> | boolean | 当前ListItem元素是否可以被鼠标框选。<br/>**说明:**<br/>外层List容器的鼠标框选开启时,ListItem的框选才生效。<br/>默认值:true |
| swipeAction<sup>9+</sup> | {<br/>start?:&nbsp;CustomBuilder&nbsp;\|&nbsp;SwipeActionItem,<br/>end?:CustomBuilder&nbsp;\|&nbsp;SwipeActionItem,<br/>edgeEffect?:&nbsp;[SwipeEdgeEffect](#swipeedgeeffect9枚举说明),<br/>} | 用于设置ListItem的划出组件。<br/>- start:&nbsp;ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。<br/>- end:&nbsp;ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。<br/>- edgeEffect:&nbsp;滑动效果。<br/>- swipeActionItem:&nbsp;ListItem向右滑动时,item左边的长距离滑动删除选项或向左滑动时,item右边的长距离滑动删除选项(List垂直布局时)。ListItem向上滑动时,item下边的长距离滑动删除选项或向下滑动时,item上边的长距离滑动删除选项(List水平布局时)<br/>**说明:** <br/>start和end对应的@builder函数中顶层必须是单个组件,不能是if/else、ForEach、LazyForEach语句。 |
| swipeAction<sup>9+</sup> | {<br/>start?:&nbsp;CustomBuilder&nbsp;\|&nbsp;[SwipeActionItem](#SwipeActionItem10对象说明),<br/>end?:CustomBuilder&nbsp;\|&nbsp;[SwipeActionItem](#SwipeActionItem10对象说明),<br/>edgeEffect?:&nbsp;[SwipeEdgeEffect](#swipeedgeeffect9枚举说明),<br/>} | 用于设置ListItem的划出组件。<br/>- start:&nbsp;ListItem向右划动时item左边的组件(List垂直布局时)或ListItem向下划动时item上方的组件(List水平布局时)。<br/>- end:&nbsp;ListItem向左划动时item右边的组件(List垂直布局时)或ListItem向上划动时item下方的组件(List水平布局时)。<br/>- edgeEffect:&nbsp;滑动效果。<br/>- swipeActionItem:&nbsp;ListItem的长距离滑动删除选项<br/>**说明:** <br/>start和end对应的@builder函数中顶层必须是单个组件,不能是if/else、ForEach、LazyForEach语句。 |
## Sticky<sup>(deprecated)</sup>枚举说明
从API version9开始废弃,推荐使用[List组件stickyStyle枚举](ts-container-list.md#stickystyle9枚举说明)
......@@ -52,13 +52,14 @@ ListItem(value?: string)
| None | ListItem划动距离不能超过划出组件大小。 |
## SwipeActionItem<sup>10+</sup>对象说明
ListItem向右滑动时,item左边的长距离滑动删除选项或向左滑动时,item右边的长距离滑动删除选项(List垂直布局时)。ListItem向上滑动时,item下边的长距离滑动删除选项或向下滑动时,item上边的长距离滑动删除选项(List水平布局时)。
| 名称 | 参数类型 | 必填 | 描述 |
| -------------------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| deleteAreaDistance | [Length](ts-types.md#length) | 否 | 设置组件长距离滑动删除距离阈值 <br/>**说明:** <br/>如果没有设置删除距离阈值就不会触发删除。|
| onDelete | () => **void** | 否 | 组件进入长距删除区后删除ListItem时调用。<br/>进入长距删除区后,抬手时触发;或者滑动速度大于初始速度阈值时触发 |
| onEntryDeleteArea | () => **void** | 否 | 在滑动条目进入删除区域时调用,只触发一次,当再次进入时仍触发。 |
| onExitDeleteArea | () => **void** | 否 |当滑动条目退出删除区域时调用,只触发一次,当再次退出时仍触发。 |
| deleteAreaDistance | [Length](ts-types.md#length) | 否 | 设置组件长距离滑动删除距离阈值 <br/>**说明:** <br/>如果没有设置删除距离阈值就不会触发删除。|
| 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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册