Communicating Between Two Components
I have two
header.vuecontains a button that is supposed to toggle open or shut the drawer (it does so by toggling a boolean value to true or false).
datathat needs to be toggled when the button is clicked (i.e., it contains the boolean value).
How can I get the two files to communicate with one another without having to combine the contents of the two file into a single
qyloxe last edited by qyloxe
@moshemo put the variable drawerOpen in Vuex then in both components you can use vue computed getter and setter:
The code for those getters you can even put in the mixins and import it in both components: