How to open a drawer component in Quasar 0.8 ?
-
-
I have a quasar drawer isolated in a component (LeftSideBar.vue)
-
A main component imports the LeftSideBar.vue.
-
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
-
-
You can use some Vue events. Alternatively you can make use of the Events bus supplied by Quasar.
-
@rstoenescu Thanks for the pointers. Time to dive deeper into VueJS
-
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.
-
@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