# vue-preventedup-plugin

Latest version **1.0.3** (published 2019-06-06) · 0 weekly downloads

## Install

```sh
npm install vue-preventedup-plugin
pnpm add vue-preventedup-plugin
yarn add vue-preventedup-plugin
bun add vue-preventedup-plugin
```

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-06-06 |
| First published | 2019-06-05 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Unpacked size | 485.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | chenglie33 |

## Links

- npm: https://www.npmjs.com/package/vue-preventedup-plugin
- Homepage: https://github.com/chenglie33/vue-dynamic2.x/tree/debounce
- npm.io page: https://npm.io/package/vue-preventedup-plugin

## Dependencies (6)

- [vue](https://npm.io/package/vue.md) ^2.6.6
- [vuex](https://npm.io/package/vuex.md) ^3.1.1
- [vue-router](https://npm.io/package/vue-router.md) ^3.0.6
- [vue-class-component](https://npm.io/package/vue-class-component.md) ^6.0.0
- [vue-property-decorator](https://npm.io/package/vue-property-decorator.md) ^7.0.0
- [register-service-worker](https://npm.io/package/register-service-worker.md) ^1.6.2

## Recent versions

- 1.0.3 (latest) — 2019-06-06
- 1.0.2 — 2019-06-06
- 1.0.1 — 2019-06-05
- 1.0.0 — 2019-06-05

## README

# vue-preventedup


> 添加防抖指令
> 添加节流指令
> 添加防抖全局方法

## Build Setup

``` bash
# install dependencies
npm i vue-preventedup-plugin

#how to use
import Debounce from vue-preventedup-plugin
Vue.use(Debounce, { DebounceTime: 200, ThrottleTime: 200 })
<button v-debounce:click="clickconsole">防抖指令</button>
<a href="www.baidu.com" v-debounce:click.prevent="clickconsole">防抖指令</a>
传入参数用法
v-debounce:click.prevent.self="{ fn: Function, arg: [2] }" arg类似arguments
 <div
      v-throttle:scroll.passive="scor"
      style="width:200px;background:#dfdfdf;height:300px;overflow:auto"
    >
      <div style="width:100px;background:#ef3e4a;height:2000px"></div>
    </div>



    //方法的使用 主意这里是闭包 需要传入上下文并且 条件组件销毁是处理掉闭包的占用内存  github代码可以直接运行
    Vue._debounce((v: string | number, ctx: any) => {
    ctx.msg++;
    console.log(v, this);
  })
```

---
_Source: https://npm.io/package/vue-preventedup-plugin · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
