Skip to content
New issue

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

Vue 3 support #49

Open
LauBeck opened this issue Apr 6, 2021 · 9 comments
Open

Vue 3 support #49

LauBeck opened this issue Apr 6, 2021 · 9 comments

Comments

@LauBeck
Copy link

LauBeck commented Apr 6, 2021

First of all.. Thank you for your nice work with handling of idle state.

We've encountered warnings using idle-vue with Vue 3 - regarding new naming conventions in Vue 3. Where the destroyed() functionality is now called unmounted.

Could this be changed in at new version bundle, to support Vue 3 ?

@Hoviadin
Copy link

Hoviadin commented Apr 7, 2021

+1 Could this be changed in at new version bundle, to support Vue 3 ?

@Hoviadin
Copy link

Hoviadin commented Apr 7, 2021

@MoeNeuron
Copy link

@LauBeck were you able to make the plugin compatible with Vue 3 or have you maybe found any other good alternatives?

@brent-williams
Copy link

@MoeNeuron idle-vue just wraps idle-js, you can use idle-js directly in Vue 3 without any issues.

@ux-engineer
Copy link

Upcoming?

1 similar comment
@ghost
Copy link

ghost commented Feb 25, 2022

Upcoming?

@pratik227
Copy link

#59

@liamcharmer
Copy link

@pratik227 how can this be implemented into Nuxt 3?

@pratik227
Copy link

pratik227 commented Feb 24, 2023

@liamcharmer

I think you need to create one plugin like idle-vule.js file where you need to register the idle-vue and then add that in nuxt.config.ts.

//idle.js
import IdleVue from "idle-vue";
import emitter from "tiny-emitter/instance";

export default function ({ app }) {
  app.use(IdleVue, {
    eventEmitter: {
      $on: (...args) => emitter.on(...args),
      $once: (...args) => emitter.once(...args),
      $off: (...args) => emitter.off(...args),
      $emit: (...args) => emitter.emit(...args)
    },
    idleTime: 1000
  });
}

// nuxt.config.ts
export default defineNuxtConfig({
  modules: [
    'idle.js',
  ],
})

Something like this Not familiar with Nuxt too much but you can try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants