Home

Issue: 1290

[Need help] is that possible to have 1 store but call and update separate 2 container?

[issue link]

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 toggleMenuon 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.

This question is available on Nuxt.js community (#c1142)