Currently, I am looping through a dictionary that is imported from a .json file and I want to compare an attribute in my props
with a value in the dictionary. The first div defines the attribute variable to be one of the values in the dictionary, specifically having the value "event", which is the desired outcome.
The issue arises in the inner div, as the props.item.${attribute}
code does not result in props.item.event
as expected. Is there a way to dynamically insert the value of this variable into my props statement?
<div
v-for="data in dict"
:set="attribute = data.targetAttr"
>
<div v-if="props.item.attribute == data.key">
<a
:href="data.response"
target="_blank"
>
More Info
</a>
</div>
</div>
I have explored a similar issue on Stack Overflow, but the solutions provided were more focused on mapping over lists rather than my specific problem.