This is the JSON response we are getting. Missing some very simple VUEJS logic to meet our requirements.
If the JSON object is empty we need to show the DIV accordingly. But, when I try with length function it's not working. Can anyone help to solve this issue?
{
"moduleInfo": {
"moduleType": "LONG"
},
"FlightElements": {
"modulenames": {
"Ele1": "Flight Parts",
"Ele2": "Flight Wings"
}
}
}
<!-- If moduleType is LONG and "Modulesnames" are available -->
<div class="display-container" v-if='moduleType=="LONG" && !FlightElements.modulenames.length'>
<p>Display Modules</p>
<div>
<!-- If moduleType is LONG and "Modulesnames" is empty -->
<div class="display-container" v-if='moduleType=="LONG" && FlightElements.modulenames.length'>
<p>Display Empty Modules</p>
<div>