When I request sight information from the Google Places API, some sights include an opening_hours
object field with weekday_text
and open_now
fields. However, some sights do not have this structure, resulting in an error.
<p v-if='sight.opening_hours && sight.opening_hours.open_now'>Open now</p>
<p v-if='sight.opening_hours && !sight.opening_hours.open_now'>Closed now</p>
<p v-if='sight.opening_hours && sight.opening_hours.weekday_text' v-for='day in this.sight.opening_hours.weekday_text'>{{ day }}</p>
Am I missing cases where sight.opening_hours
or sight.opening_hours.weekday_text
do not exist? The issue seems to be related to the v-for loop, as everything works fine when it is removed.