As I venture into the world of Vue JS HTML templates, I am exploring how to bind styles using arrow functions. My goal is to toggle the visibility of a div that originates from the Vuex store.
Below is my current attempt at achieving this. The main_activity_opened
variable has been passed to the component through mapState
.
<div
class="main-panel"
:style="{ display: () => main_activity_opened ? 'block' : 'none' }">
Unfortunately, this approach is not working as expected. I am curious if this method is advisable and open to suggestions on how to make it functional.