Awesome Open Source
Awesome Open Source

vue-esc

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

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

Support

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 ❤️


Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
javascript (70,283) 
vuejs (1,110) 
vue-directive (23)