Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update demo #19

Merged
merged 1 commit into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: [Talljack]
1 change: 0 additions & 1 deletion .github/.dependabot.yml → .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ updates:
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
30 changes: 16 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
# vue3-hotKey
Vue3 hooks of Keyboard events
Vue3 hooks of Keyboard events.

## 📦 Install

```bash
pnpm i vue3-hotkey

or

yarn add vue3-hotkey
```

## 🦄 Usage
```ts
import useHotkey, { HotKey } from 'vue3-hotkey'
import useHotkey, { HotKey, RemoveHandler } from 'vue3-hotkey'
import { ref } from 'vue'
setup() {
const hotkeys = ref<HotKey[]>([
Expand All @@ -22,23 +32,15 @@ setup() {
}
}
])
const stop = useHotkey(hotkeys.value)
const stopArr = useHotkey(hotkeys.value)

// 取消监听快捷键
stop()
const removeHotKeys = (hk: HotKey) => {
stopArr.foreach((item: RemoveHandler) => item())
}
}
```

## 📦 Install

```bash
pnpm i vue3-hotkey

or

yarn add vue3-hotkey
```

## 🌸 Thanks
This project is heavily inspired by the following awesome projects.

Expand Down
13 changes: 7 additions & 6 deletions demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,16 @@
"serve": "vite preview"
},
"dependencies": {
"vue": "^3.3.4",
"naive-ui": "^2.38.1",
"vue": "^3.4.21",
"vue3-hotkey": "^1.0.5"
},
"devDependencies": {
"@vitejs/plugin-vue": "^4.4.1",
"@vue/compiler-sfc": "^3.3.4",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vue-tsc": "^1.8.15"
"@vitejs/plugin-vue": "^5.0.4",
"@vue/compiler-sfc": "^3.4.21",
"typescript": "^5.4.2",
"vite": "^5.1.5",
"vue-tsc": "^2.0.6"
},
"author": "Talljack",
"license": "ISC"
Expand Down
Loading
Loading