'Events' is not defined



  • I just started learning Quasar, and while testing I’m importing all components and directives using the following:

    // main.js
    import Quasar, * as All from 'quasar'
    
    Vue.use(Quasar, {
      components: All,
      directives: All
    })
    

    Then, when I try to use Events.$on (in main.js), Events is not recognized and I get the following Eslint error:

    ‘Events is not defined’

    How do I globally import Events along with all components and directives?

    Thanks for your help :-)



  • in this case you should access All.Events. This will not make the Events variable globally available, make sure to import in any file you need. Finally, doing thins this way WILL cause some conflicts, so if you are doing more than a simple test be sure to import components properly.



  • @benoitranque

    Great! Thanks :-)


Log in to reply
 

Looks like your connection to Quasar Framework was lost, please wait while we try to reconnect.