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

    How to open a drawer component in Quasar 0.8 ?

    Help
    quasar-drawer
    2
    5
    2298
    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.
    • Martin
      Martin last edited by Martin

      1. I have a quasar drawer isolated in a component (LeftSideBar.vue)
        0_1478450460100_img2412.jpg

      2. A main component imports the LeftSideBar.vue.

      3. The main component has a menu button in its header that should open the drawer component.
        How can I achieve this? The “ref” obviously doesn’t work since its located in another file

      0_1478450855342_upload-6825b2c2-1b76-4e13-95e6-617cdee1a4b2

      1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin last edited by

        You can use some Vue events. Alternatively you can make use of the Events bus supplied by Quasar.

        Martin 1 Reply Last reply Reply Quote 0
        • Martin
          Martin @rstoenescu last edited by

          @rstoenescu Thanks for the pointers. Time to dive deeper into VueJS 🤓

          1 Reply Last reply Reply Quote 0
          • rstoenescu
            rstoenescu Admin last edited by

            http://quasar-framework.org/api/js-events.html

            There are other options than using Vue events or Quasar event bus, but only these allow communication between any components.

            Martin 1 Reply Last reply Reply Quote 0
            • Martin
              Martin @rstoenescu last edited by

              @rstoenescu Events work very well. Thanks.
              Other option would be using “refs” as described in this post (opening a modal vue component with a button located on the main component)

              http://forum.quasar-framework.org/topic/43/modal-create-vuecomponent-in-quasar-0-8

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