Talljack / vue3-hotKey

vue3 hooks of keyboard input.

Home Page:https://vue3-hot-key-demo.vercel.app/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

window is not defined

kstan79 opened this issue · comments

commented

Hi, Im trying use this library in nuxt3 but i get below msg:
vue-hotkey

here is my code

const hotkeys = ref<HotKey[]>([
    {
      keys: ['shift','enter'],
      preventDefault: true,
      handler (keys) {
        console.log("shortcut",keys)
        newData()
      }
    },
    {
      keys: ['shift', 'space'],
      preventDefault: true,
      handler(keys) {
        console.log("shortcut",keys)
        newData()
      }
    }
  ])
  console.log(hotkeys.value);

maybe I need to be compatible with nuxt. I'll to do it