My challenge involves managing a website that is designed to receive boolean values and store them in an array where the key represents the ID and the value represents the boolean.
For example:
policiesActive[
"2" => false,
"3" => false]
The website includes a list-group with three items.
For instance:
.list-group
a.list-group-item.list-group-item-action.flex-column.align-items-start(v-for='firewallPolicy in activeFirewall.policies', href='', @click.prevent='setPolicyActive(activeFirewall.id, firewallPolicy.id)', v-bind:class='{ active: policiesActive[firewallPolicy.id] }')
.d-flex.w-100.justify-content-between
h5.mb-1 {{firewallPolicy.name}}
p.mb-1 {{firewallPolicy.description}}
Each list-group item needs to be checked to determine if it is active or not. The first two are compared against policiesActive
, while the third one should be true only if both values in policiesActive
are false.
I am struggling to figure out how to handle this last scenario where both values are false. Can you provide any guidance?