feat: modify directive

This commit is contained in:
Javier Segarra 2025-01-30 20:29:54 +01:00
parent af940c67c6
commit c067006d08
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
export default { export default {
mounted(el, binding) { mounted(el, binding) {
const shortcut = binding.value ?? '+'; const shortcut = binding.value || '+';
const { key, ctrl, alt, callback } = const { key, ctrl, alt, callback } =
typeof shortcut === 'string' typeof shortcut === 'string'
@ -8,7 +8,7 @@ export default {
key: shortcut, key: shortcut,
ctrl: true, ctrl: true,
alt: true, alt: true,
callback: () => el.click(), callback: () => el?.click(),
} }
: binding.value; : binding.value;