We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import hotkeys, { KeyHandler } from 'hotkeys-js'; import { onMounted, onUnmounted } from 'vue'; export const useHotKeys = (key: string, callback: KeyHandler, global = true): void => { onMounted(() => { hotkeys(key, callback); }); onUnmounted(() => { if (global) { hotkeys.unbind(key); } else { hotkeys.unbind(key, callback); } }); }; 这边使用的话 useHotKeys('ctrl+n, command+n', keyHandleCreate, false); useHotKeys('arrowup, arrowdown,ArrowDown,ArrowUp, ArrowRight', keyHandleUpdown, false); //不生效 控制台不打印
The text was updated successfully, but these errors were encountered:
No branches or pull requests
import hotkeys, { KeyHandler } from 'hotkeys-js';
import { onMounted, onUnmounted } from 'vue';
export const useHotKeys = (key: string, callback: KeyHandler, global = true): void => {
onMounted(() => {
hotkeys(key, callback);
});
onUnmounted(() => {
if (global) {
hotkeys.unbind(key);
} else {
hotkeys.unbind(key, callback);
}
});
};
这边使用的话
useHotKeys('ctrl+n, command+n', keyHandleCreate, false);
useHotKeys('arrowup, arrowdown,ArrowDown,ArrowUp, ArrowRight', keyHandleUpdown, false); //不生效 控制台不打印
The text was updated successfully, but these errors were encountered: