Skip to content

Commit 4ad0297

Browse files
author
Fagner Araujo
committed
Merge branch 'rodrigopv-master'
2 parents 1f0f017 + 64f3093 commit 4ad0297

File tree

6 files changed

+2966
-3643
lines changed

6 files changed

+2966
-3643
lines changed

README.md

+8-6
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
[![npm](https://img.shields.io/npm/dt/vue-shortkey.svg)](https://www.npmjs.com/package/vue-shortkey)
66
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)
77

8-
Vue-ShortKey - plugin for VueJS 2.x accepts shortcuts globaly and in a single listener.
8+
Vue3-ShortKey - a fork/port of `vue-shortkey` for VueJS 3.x accepts shortcuts globaly and in a single listener. I'm not vue3 expert, but I edited this plugin until it started working on Vue-cli with Vue 3.
99

1010
## Install
1111
```
12-
npm install vue-shortkey --save
12+
npm install vue3-shortkey --save
1313
```
1414

1515
## Usage
1616
```javascript
17-
Vue.use(require('vue-shortkey'))
17+
Vue.use(require('vue3-shortkey'))
1818
```
1919
Add the shortkey directive to the elements that accept the shortcut.
2020
The shortkey must have explicitly which keys will be used.
@@ -126,12 +126,12 @@ You can avoid shortcuts within fields if you really need it. This can be done in
126126
* Generalizing type of element that will not perform shortcut. To do this, insert a list of elements in the global method.
127127
128128
```javascript
129-
Vue.use('vue-shortkey', { prevent: ['input', 'textarea'] })
129+
Vue.use('vue3-shortkey', { prevent: ['input', 'textarea'] })
130130
```
131131
132132
* Or even by class
133133
```javascript
134-
Vue.use('vue-shortkey', { prevent: ['.my-class-name', 'textarea.class-of-textarea'] })
134+
Vue.use('vue3-shortkey', { prevent: ['.my-class-name', 'textarea.class-of-textarea'] })
135135
```
136136
137137
#### Other uses
@@ -151,7 +151,9 @@ With the dynamism offered by Vue, you can easily create shortcuts dynamically
151151
152152
#### Integrating with Nuxt
153153
154-
Create `/plugins/vue-shortkey.js` and add the following to it
154+
## Nuxt doesn't support Vue3 yet, use the original package for NuxtJS.
155+
156+
Create `/plugins/vue3-shortkey.js` and add the following to it
155157
156158
```javascript
157159
import Vue from 'vue'

dist/index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)