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

    Required module for use in the entire project

    Framework
    2
    3
    110
    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.
    • K
      keechan last edited by

      Hi,

      Using the quasar framework, is it possible to require a module only once and have it accessible throughout the project?

      This is because I am creating a debug logger module. I do not want the user to re-configure it after every require on every file.

      Thoughts??

      Thanks!

      metalsadman 1 Reply Last reply Reply Quote 0
      • metalsadman
        metalsadman @keechan last edited by

        @keechan register it in a boot file https://quasar.dev/quasar-cli/boot-files#Anatomy-of-a-boot-file. if you also register it as a Vue prototype then you can call it directly in your components, ie. this.$debugger(...).

        K 1 Reply Last reply Reply Quote 0
        • K
          keechan @metalsadman last edited by

          @metalsadman Great, this is exactly what I was looking for! Thanks man!

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