Closed phivk closed 5 years ago
According to documentation, for Nuxt.js <2.4 change plugins in nuxt.config.js as follow:
plugins: [
{ src: '@/plugins/idle-vue.js', ssr: false}
],
For Nuxt 2.4< use this:
plugins: [
{ src: '@/plugins/idle-vue.js', mode: 'client'}
],
thanks for pointing me in the right direction, this works 👍
I'm trying to use this plugin in Nuxt.js. So far I did (based on the example code):
npm install --save idle-vue
/plugins/idle-vue.js
with the following content:const eventsHub = new Vue()
Vue.use(IdleVue, { eventEmitter: eventsHub, idleTime: 10000 })
plugins: [ { src: '@/plugins/idle-vue.js'} ],
onIdle() { console.log('ZZZ'); }, onActive() { console.log('Hello'); },