未验证 提交 6b08d748 编写于 作者: L limeng 提交者: Gitee

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

Signed-off-by: Nlimeng <limeng208@huawei.com>
上级 66dc9e88
......@@ -149,25 +149,19 @@ struct ListItemExample2 {
// xxx.ets
@Entry
@Component
struct ListItemExample3 {
struct ListItemExample2 {
@State message: string = 'Hello World'
@State arr: number[] = [0, 1, 2, 3, 4]
@State enterEndDeleteAreaString: string = "not enterEndDeleteArea"
@State exitEndDeleteAreaString: string = "not exitEndDeleteArea"
@Builder itemEnd(value: number) {
@Builder itemEnd() {
Row() {
Button("Delete").margin("4vp")
.onClick(() => {
animateTo({ duration: 1000 }, () => {
let index = this.arr.indexOf(value)
this.arr.splice(index, 1)
})
})
Button("Set").margin("4vp")
}.padding("4vp").justifyContent(FlexAlign.SpaceEvenly)
}
.padding("4vp")
.justifyContent(FlexAlign.SpaceEvenly)
}
build() {
Column() {
List({ space: 10 }) {
......@@ -182,7 +176,8 @@ struct ListItemExample3 {
.backgroundColor(0xFFFFFF)
}
.transition({ type: TransitionType.Delete, opacity: 0 })
.swipeAction({ end: {
.swipeAction({
end: {
builder: this.itemEnd.bind(this, item),
useDefaultDeleteAnimation: true,
onDelete: () => {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册