Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

虚拟列表插槽中,如何拿到上一条和下一条数据 #187

Open
seepine opened this issue Feb 27, 2025 · 1 comment
Open

虚拟列表插槽中,如何拿到上一条和下一条数据 #187

seepine opened this issue Feb 27, 2025 · 1 comment
Labels
question Further information is requested

Comments

@seepine
Copy link

seepine commented Feb 27, 2025

** 请描述您在使用期间遇到的疑问 **
使用场景是聊天模式,消息时间相近的不展示发送时间,例如能否多传递 nextItem, lastItem

<template #cell={item, index, nextItem, lastItem}>
@seepine seepine added the question Further information is requested label Feb 27, 2025
@SmileZXLee
Copy link
Owner

目前可以给虚拟列表添加v-model="dataList",然后根据dataList[index - 1]dataList[index + 1]获取,注意下边界的情况即可。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants