I have very little JavaScript experience and no vue or react experience, so understanding these answers is proving to be futile. >.<
I found these 2 solutions
This is the issue I am encountering.
- I got the x-data and x-show to work for the collapse sidebar button.
- When I added another x-data element in a child div that houses the content, it seems to break everything and nothing works.
- Both the sidebar div, and content div are inside the parent div that controls the collapse button.
This is how the layout looks like
This is the code of how it is somewhat layed out
// Div that houses main content and sidebar
<div x-data="{sidebarActive: true}">
// Sidebar button
<div @click="sidebarActive =!sidebarActive"> collapse icon </div>
// kanban content
<div x-data ="{kanbanToggle: 2}">
// toggle buttons
<div>
<div @click="kanbanToggle: 1"> button 1 </div>
<div @click="kanbanToggle: 2"> button 2 </div>
<div @click="kanbanToggle: 3"> button 3 </div>
</div>
// kanban board content
<div>
<div x-show ="kanbanToggle ===1"> timeline view </div>
<div x-show ="kanbanToggle ===2"> card view </div>
<div x-show ="kanbanToggle ===3"> list view </div>
</div>
</div>
<div x-show="{sidebarActive:true}"> sidebar content </div>
</div>
Any help much appreciated! Thanks in advance!