0.2.0 • Published 3 years ago

vue-use-hotkey v0.2.0

Weekly downloads
6
License
MIT
Repository
github
Last release
3 years ago

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!')
        }
      }
    ])
  }
})
0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago