# vue3.0-infinite-scroll

> 支持Vue3的滚动加载插件

Latest version **2.0.0** (published 2022-06-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue3.0-infinite-scroll
pnpm add vue3.0-infinite-scroll
yarn add vue3.0-infinite-scroll
bun add vue3.0-infinite-scroll
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0 |
| Published | 2022-06-15 |
| First published | 2021-12-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 306.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 13 |
| Author | kfhechenglong |
| Maintainers | kfhechenglong |
| Keywords | Vuejs, Vue3, Vue, Vue3.0-infinite-scroll, 无限滚动加载, infinite-scroll |

## Links

- npm: https://www.npmjs.com/package/vue3.0-infinite-scroll
- Repository: https://github.com/kfhechenglong/vue3.0-infinite-scroll
- Homepage: https://github.com/kfhechenglong/vue3.0-infinite-scroll#readme
- Issues: https://github.com/kfhechenglong/vue3.0-infinite-scroll/issues
- npm.io page: https://npm.io/package/vue3.0-infinite-scroll

## Recent versions

- 2.0.0 (latest) — 2022-06-15
- 1.1.1 — 2022-01-29
- 1.1.0 — 2022-01-29
- 1.0.0 — 2021-12-28
- 0.1.1 — 2021-12-28
- 0.1.0 — 2021-12-27

## README

# vue3.0-infinite-scroll

## 介绍
vue3.0无限滚动加载
# Install
```
npm install vue3.0-infinite-scroll --save
```

# API

| 参数 | 说明 | 类型 | 默认值 | 版本 |
| --- | --- | --- | --- | --- |
| infinite-scroll-throttle-delay | 滚动延迟 | number | 200 |  |
| infinite-scroll-disabled | 是否禁止 | boolean | false |  |
| infinite-scroll-distance | 滚动条距离底部的距离 | number | 0 |  |
| infinite-scroll-immediate-check | 是否立即触发滚动 | boolean | true |  |
| infinite-scroll-watch-disabled | 与`infinite-scroll-disabled`绑定的对应值 | string | null

# 指令

| 指令名称 | 说明                 | 回调参数                | 版本 |
| -------- | -------------------- | ----------------------- | ---- |
| v-infinite-scroll    | 指令，执行滚动触发的事件 | () => void | -    |


## 使用示例

演示地址>>>[demo](https://kfhechenglong.github.io/vue3.0-infinite-scroll/dist/index.html)

### 注册指令

```js
app.use(infiniteScroll).mount('#app')
```

### 在组件中使用
```html
<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>
```

```js
setup(props, context) {
  const renderDataList = [] // 数据列表
  const listCount = 50
  const handleInfiniteOnLoad = () => {
    // 异步加载数据等逻辑
    if (scrollDisabled) {
      // 数据加载完毕
    } else {
      // 加载数据列表
    }
  }
  const scrollDisabled = computed(() => renderDataList.length >= listCount)
  return {
    scrollDisabled,
    handleInfiniteOnLoad
  }
}
```

---
_Source: https://npm.io/package/vue3.0-infinite-scroll · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
