I need to display Div element if specific value exists on JSON object and I have tried using array I could success but I don't know how to do in JSON object. Simply I need to display div if value called "Channel" exists on JSON object.
Below code that I tried but it didn't work
activationTypes: [
{
"activationTypeId": 1,
"name": "SMS"
},
{
"activationTypeId": 2,
"name": "WEB"
},
{
"activationTypeId": 3,
"name": "Channel"
}
]
<div v-show="Object.values(activationTypes).includes('Channel')">
<p>test<test>
</div>
Object.values(activationTypes)is an array of objects, you need to check if one of those objects has a name property with the valueChannel