vue-esc

:running: Vue.js directive to add a document event listener on escape keyup.
7,191
Install
npm install vue-esc
Latest Version:3.0.1
License:MIT
Last Updated:Feb 23, 2019
Links: npm
Maintainer: ianaya89

vue-esc

:running: Vue.js directive to add a document event listener on escape keyup.

Codeship Status for ianaya89/vue-esc Coverage Status Codacy Badge

Support

  • Vue.js 2 => vue-esc@>=2.0.0 [master]
  • Vue.js 1 => vue-esc@1.0.0

Install

$ npm i -S vue-esc
$ yarn add vue-esc

Use

// main.js

import Vue from 'vue';
import VueEsc from 'vue-esc';

Vue.use(VueEsc);
<script>
  // Component.vue

  export default {
    name: 'Component',

    methods: {
      escape(event) {
        console.log('Esc key pressed.', `Event: ${event}`);
      }
    }
  };
</script>

<template>
  <div v-esc="escape"></div>
</template>

Development

# install dependencies
$ npm install

# dev mode
$ npm run dev

# test
$ npm run test

# build
$ npm run build

License

MIT License

Style

js-standard-style


This project was built with yeoman and generator-vue-component ❤️

Related Packages

vue3-highlight-text

a vue3 directive of highlight text

84,789
vue-proportion-directive

vue 固定元素比例指令

6,003 10
ardirectives

Ardirectives

811
vue-on-click-outside

vue mixin/directive that does something when you click outside a container

169,297 31
vue-bind-once

A tiny, SSR-safe directive for binding random data to an element.

152,016 169

Version History

Version Released License
3.0.1 MIT
3.0.0 MIT
2.0.0 MIT
1.0.0 MIT
0.0.5 MIT