0.0.12 • Published 9 months ago

@ylzq/v2ds v0.0.12

Weekly downloads
-
License
ISC
Repository
github
Last release
9 months ago

@ylzq/v2ds

vue自定义指令增强库

使用方式:

  • 安装:npm i @ylzq/v2ds -S
  • 全局导入(main.js):
    import v2ds from '@ylzq/v2ds'
    Vue.use(v2ds)
  • 按需全局导入:
    Vue.use(v2ds, [ 'debounce', ... ])
  • 按需导入(具体vue组件实例)
    import { debounce, throttle } from '@ylzq/v2ds'
    export default {
      directives: {
        debounce,
        throttle
      }
    }

当前封装的自定义指令

  • debounce
    • 描述:防抖
    • 使用方式:v-debounce:<event>.<sync>="<callback>"
      • event: 所需要代理的事件,比如:click。
      • sync: 修饰符。当前仅支持emit此为兼容在vue自定义组件中使用,为了代理@\<event>=“\<callback>”的方式
      • callback: 回调方法
  • throttle
    • 描述:节流
    • 使用方式:v-throttle:<event>.<sync>="<callback>"
      • event: 所需要代理的事件,比如:click。
      • sync: 修饰符。当前仅支持emit此为兼容在vue自定义组件中使用,为了代理@\<event>=“\<callback>”的方式
      • callback: 回调方法
0.0.12

9 months ago

0.0.11

9 months ago

0.0.10

9 months ago

0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago