I'm having a problem changing the render state of an element with vue js. The same was generated with for
. The goal is to have box-body
of the mini panel displayed by clicking button
. but the v-if
state is changed only when I trigger another click event on another element there it renders the html.
<div class="col-lg-9">
<div class="row">
<div v-for="(beach, index) in markers" :key="index" class="col-md-3 mx-0 px-1 my-1">
<div class="box box-default box-solid">
<div class="box-header with-border">
<h3 class="box-title">{{beach.label}}</h3>
<div class="box-tools pull-right">
<button type="button" @click="beach.show =! beach.show;" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<div v-if="beach.show">
<div class="box-body">
<h5>{{beach.infoText}}</h5>
</div>
</div>
</div>
</div>
</div>
</div>