Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

vue3-infinite-scroll-better

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vue3-infinite-scroll-better

支持Vue3的滚动加载插件,所有用法和vue-infinite-scroll一致。并解决了一些bug。

  • 2.1.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

vue3.0-infinite-scroll

介绍

vue3.0无限滚动加载

Install

npm install vue3.0-infinite-scroll --save

API

参数说明类型默认值版本
infinite-scroll-throttle-delay滚动延迟number200
infinite-scroll-disabled是否禁止booleanfalse
infinite-scroll-distance滚动条距离底部的距离number0
infinite-scroll-immediate-check是否立即触发滚动booleantrue
infinite-scroll-watch-disabledinfinite-scroll-disabled绑定的对应值stringnull

指令

指令名称说明回调参数版本
v-infinite-scroll指令,执行滚动触发的事件() => void-

使用示例

演示地址>>>demo

注册指令

app.use(infiniteScroll).mount('#app')

在组件中使用

<div
  class="poster-list-lis"
  v-infinite-scroll="handleInfiniteOnLoad"
  :infinite-scroll-immediate-check="false"
  :infinite-scroll-disabled="scrollDisabled"
  infinite-scroll-watch-disabled="scrollDisabled"
  :infinite-scroll-distance="20">
</div>
setup(props, context) {
  const renderDataList = [] // 数据列表
  const listCount = 50
  const handleInfiniteOnLoad = () => {
    // 异步加载数据等逻辑
    if (scrollDisabled) {
      // 数据加载完毕
    } else {
      // 加载数据列表
    }
  }
  const scrollDisabled = computed(() => renderDataList.length >= listCount)
  return {
    scrollDisabled,
    handleInfiniteOnLoad
  }
}

Keywords

FAQs

Package last updated on 15 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc