Skip to content

列表项删除,index变更问题 #32

@swen624

Description

@swen624

现象:
有个总共110条数据的长列表,滑到最底下,视图对应的recycleList有60条。
现在想左滑删除一条内容,通过touchMove拿到的index是视图短列表的55,但是ctx.splice要用的index应该是完整列表的index,于是通过item.__index__拿到105,调用ctx.splice(105,1)删除;
但是删除以后,后面的__index__并不会更新,再通过item.__index__获取就不准确了。比如新的长列表实际index 105,他的item.__index__是106。

疑问:
有没有更新__index__的方法?
或者有没有更好的删除方法?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions