Answer the question
In order to leave comments, you need to log in
How to write v-if for the case if the total array contains at least one element with the desired value?
I'm just learning Vue, there is a small issue that I'm blunted on.
Now there is a condition to display the block if the offer code is 156:
<div v-for="offer in tour.offers" v-if="offer.code == 156">
<div class="vue-night tables_cell">
<div class="vue-text vue-line">{{ offer.nights }}</div>
</div>
<div class="vue-room tables_cell">
<div class="vue-text vue-line">{{ offer.room_name }}</div>
<div class="vue-tip">{{ offer.room_name }}</div>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
https://developer.mozilla.org/ru/docs/Web/JavaScri...
In general, I would make a calculated property that returns an offer or null / undefined from the entire array of offers, which would be displayed (or not displayed), the cycle is in the layout here nafig is not needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question