Skip to content

xhfLittleTree/vue-hoykey-manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-hotkey-manager

> Set and delete hotkeys in Vue project

Install

npm install vue-hotkey-manager

Usage

import Vue from 'vue'
import hotkey from 'vue-hotkey-manager'
Vue.use(hotkey)

###example

<template>
	<el-input ref='input_1'></el-input>
</template>
  • setHotkey
this.$setHotkey(this.$refs['input_1'],'ctrl+m',
function(){
	//TODO
})

The first parameter requirement for the method is Vnode, If you set in a DOM element, the hotkey is bound to the upper Vnode

  • delHotkey
this.$delHotkey(this.$refs['input_1'],'ctrl+m')

About

Set and delete hotkeys in Vue project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published