Search code examples
vuejs3quasar-frameworkeventemitterquasar

idle-vue-3 mitt i.$emit is not a function


I am using Quasar 2 Vue 3. When I use idle-vue-3 with mitt in the following way:

import { createApp } from 'vue';
import IdleVue from "idle-vue-3";
import mitt from 'mitt';
import App from "../App.vue";
const app = createApp(App);
const emitter = mitt();
const idleTimeInMillis = 60000;
app.use(IdleVue, {
  eventEmitter: emitter, // OR eventEmitter: emitter.emit,
  store: Store,
  idleTime: idleTimeInMillis,
  startAtIdle: false
});
export default app;

I get i.$emit is not a function on the console. Any advice and insight is appreciated.


Solution

  • Remove eventEmitter: emitter,. It is not needed.