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

能不能在父级里面进行虚拟滚动 #54

Open
xzxzhixin opened this issue Aug 26, 2024 · 5 comments
Open

能不能在父级里面进行虚拟滚动 #54

xzxzhixin opened this issue Aug 26, 2024 · 5 comments
Labels
Help Wanted Extra attention is needed

Comments

@xzxzhixin
Copy link

xzxzhixin commented Aug 26, 2024

列如我这样用,

    <van-list
      ref="vanListRef"
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
      class="list"
    >
      <template #default>
        <VueVirtList
          :itemKey="itemKey"
          :list="list"
        >
          <template #default="{ itemData, index }">
            <slot v-bind="itemData"></slot>
          </template>
        </VueVirtList>
      </template>
    </van-list>

想让第三方的vant的列表就可以支持虚拟滚动

我刚这样用了一下,直接就是乱了

@apathiaX
Copy link
Collaborator

什么的场景需要这样嵌套

@xzxzhixin
Copy link
Author

移动端列表,使用vant库,已经包装好的代码,现在数据量上去了,就是想吧列表替换成虚拟滚动

@kolarorz
Copy link
Owner

移动端列表,使用vant库,已经包装好的代码,现在数据量上去了,就是想吧列表替换成虚拟滚动

不能用vant-list,它本身就是一个list组件,和虚拟列表是冲突的。建议要用的话,自己实现以下vant-list的样式交互即可

@xzxzhixin
Copy link
Author

我考虑过用虚拟列表去实现vant-list
但是实际上vant-list他不是一个列表,他是用来处理分页数据请求用的组件

@kolarorz
Copy link
Owner

这个有点麻烦的。不如用virt-list来实现一个分页功能比较简单。试试看?demo其实有的

@kolarorz kolarorz added the Help Wanted Extra attention is needed label Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Help Wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants