In my HTML, I have the values XS
, S
, and M
for all sizes in both Black
and White
. Additionally, I have a JSON object that shows the available sizes for each color.
I am looking to use v-if
to conditionally display content when the size XS
is not available in the array variant_selection.size
, based on the value of variant_selection.option1
. The sizes loaded as HTML include XS
, S
, and M
.
For example:
variant_selection: {
option1: "Black",
option2: "XS",
size: [
"Black / XS", /// Only black color has XS size
"Black / S",
"Black / M",
"White / S",
"White / M",
],
},
I attempted this approach but it did not work for me. Can someone please assist?
<span v-if="'variant_selection.option1 / {{ value }}' !== 'variant_selection.size.includes(variant_selection.option1) / {{ value }}' ">.</span>