No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    'Events' is not defined

    Help
    2
    3
    817
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      joefly last edited by joefly

      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 🙂

      1 Reply Last reply Reply Quote 0
      • benoitranque
        benoitranque last edited by

        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.

        J 1 Reply Last reply Reply Quote 0
        • J
          joefly @benoitranque last edited by

          @benoitranque

          Great! Thanks 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post