long-press-mobile

1.0.1 • Public • Published

usage

install

npm install long-press-mobile
yarn add long-press-mobile

html

    <button class="plus">plus</button>
    <button class="minus">minus</button>

javascript

import { LongPress } from 'long-press'
 
let count = 0
new LongPress('.plus', () => {
    count++
    console.log('count:', count)
})
 
new LongPress('.minus', () => {
    count--
    console.log('count:', count)
})

@params

/**
 * desc 长按页面事件
 * @param {String} selector 字符串选择器
 * @param {Function} cb 长按事件持续执行回调
 */
new LongPress(selector, cb)

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i long-press-mobile

      Weekly Downloads

      3

      Version

      1.0.1

      License

      ISC

      Unpacked Size

      3.02 kB

      Total Files

      3

      Last publish

      Collaborators

      • qingshanluoyue