类星体 q-选择无限滚动

问题描述 投票:0回答:1

如何在 q-select 上应用无限滚动?我看到有“虚拟滚动”事件返回此 json,

{索引:11,从:0,到:11,方向:'增加',参考:VueComponent}

但问题是,当您使用鼠标和滚动时,它不会更新返回数据中的索引参数,并且索引始终是最后一个灰色项目的位置,但使用键盘时,它可以工作,因为您总是将灰色项目移动到选定的列表。

如何知道滚动即将结束以触发获取数据?我应该采取另一种方法吗?

谢谢你,

select infinite-scroll quasar
1个回答
0
投票

解决方案如下:

<q-select>
    <template v-slot:option="scope">
         <q-infinite-scroll @load="onLoad" :offset="25">
          <q-item v-bind="scope.itemProps" v-on="scope.itemEvents">
            <q-item-section> </q-item-section>
          </q-item>
         </q-infinite-scroll>
    </template>
</q-select>
© www.soinside.com 2019 - 2024. All rights reserved.