I'm creating a sidebar with a lot of functionality so I need to add two conditions to my :class but I don't know how to do it. This is what I did:
:class=" showSidebar ? 'open' : 'closed', showSidebarMini ? 'openmini' : 'closedmini'"
You can use object styles to do the following:
Example:
{ 'open': showSidebar, 'closed': !showSidebar, 'openmini': showSidebarMini, 'closedmini': !showSidebarMini }
In your case:
:class="{ 'open': showSidebar, 'closed': !showSidebar, 'openmini': showSidebarMini, 'closedmini': !showSidebarMini }"
You can use class array:
:class="[(showSidebar ? 'open' : 'closed'), (showSidebarMini ? 'openmini' : 'closedmini')]"
You can use object styles to do the following:
Example:
In your case:
You can use class array: