Let's say I have isDropdownOpen
store
and toggleMenu
action
and I need to use this at 2 place, because I have 2 dropdown in the same page.
So is it possible to use only isDropdownOpen
and toggleMenu
on difference 2 dropdown but refer to parrent who click the toggle.
<div class="container1">
<div class="dropdown" :class="{hidden: isDropdownOpen}"
............
............
</div>
<a href="#" @click="toggleMenu">toggle</a>
// This will toggle dropdown in container 1
</div>
<div class="container2">
<div class="dropdown" :class="{hidden: isDropdownOpen}"
............
............
</div>
<a href="#" @click="toggleMenu">toggle</a>
// This will toggle dropdown in container 2
</div>
Thank you.
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1142">#c1142</a>)</em></sub></div>