vue-use-hotkey
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

vue-use-hotkey

Hotkey hooks for Vue 2/3.

Installation

npm install vue-use-hotkey # Using NPM
yarn add vue-use-hotkey # Using yarn

Usage

import { defineComponent } from 'vue' // '@vue/composition-api' if Vue 2
import { useHotkey } from 'vue-use-hotkey'

export default defineComponent({
  setup () {
    useHotkey([
      {
        key: ['Control', 'Space'],
        preventDefault: true,
        handler () {
          console.log('Sweet!')
        }
      }
    ])
  }
})

Readme

Keywords

none

Package Sidebar

Install

npm i vue-use-hotkey

Weekly Downloads

46

Version

0.2.0

License

MIT

Unpacked Size

7.52 kB

Total Files

16

Last publish

Collaborators

  • anesin1109