fgr-araujo / vue-shortkey

Vue-ShortKey - The ultimate shortcut plugin to improve the UX
MIT License
884 stars 101 forks source link

Document Nuxt integration #86

Closed Soviut closed 4 years ago

Soviut commented 5 years ago

It would be good to include a brief explanation in the documentation about how to integrate vue-shortkey into Nuxt.

Add /plugins/vue-shortkey.js:

import Vue from 'vue'
const ShortKey = require('vue-shortkey')

Vue.use(ShortKey, { prevent: ['input', 'textarea'] })

export default ShortKey

Load the plugin in nuxt.config.js:

plugins: [ { src: '@/plugins/vue-shortkey.js', ssr: false }]

I don't have time to make a PR right now, so consider this a reminder. The disabling of SSR is especially important.