0.1.2 • Published 7 years ago

v-hotkey-yyf v0.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
7 years ago

安装

npm install v-hotkey-yyf --save

使用

1、引入

import VueHotkey from 'v-hotkey-yyf'
Vue.use(VueHotkey)

2、配置

<template lang='pug'>
   <input v-hotkey="{keymap:keymap,isfull: false}" v-show="showing" />
</template>

<script>
export default {
  data () {
    return {
      showing: true
    }
  },
  methods: {
    keymaphandler () {
      alert('111')
    }
  },
  computed: {
    keymap () {
      return {
        'ctrl+enter': this.keymaphandler
      }
    }
  }
}
</script>

3、参数详解

事件函数

  • keydown (as default)
  • keyup

组合键

使用以下一个或多个键来激活热键

  • ctrl
  • alt
  • shift
  • meta (windows / command)
0.1.2

7 years ago

0.1.1

7 years ago

1.0.0

7 years ago