模态仅在第二次单击后显示 [英] Modal only showing after the second click

查看:50
本文介绍了模态仅在第二次单击后显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 vue2 中以 1 个组件 = 1 个文件样式进行开发.

I'm developing in 1 component = 1 file style in vue2.

我有一个通过 Bootstrap-Vue 表格组件构建的表格,我正在使用提供程序向它传递一个项目.

I have a Table constructed via a Bootstrap-Vue Table Component, I'm using the provider to pass it an items.

其中一列包含每一行的修改按钮.

one of the columns contains modify buttons for each row.

这些按钮触发引导模式.

these buttons trigger a bootstrap-modal.

我正在使用 V-if 来初始化表及其属性.

I'm using a V-if to initialize the table and its properties.

<b-modal  v-if='toShow' id="modalallergy" @hide="resetModal">
      <h4 class="my-1 py-1" slot="modal-header">Allergie {{ modalDetails._id }}</h4>
      <b-container class="bv-example-row">
            <b-row>
                <b-col>
                  identifiant : {{modalDetails.data.content}}
                </b-col>
                <b-col>
                Catégorie : {{modalDetails.data.content}}
                </b-col>
            </b-row>
            </b-container>
    </b-modal>

    <b-modal id="modalallergy-edit" @hide="resetModal">
      <h4 class="my-1 py-1" slot="modal-header">Edition de l'allergie {{ modalDetails._id }}</h4>
      <pre>{{ modalDetails.data}}</pre>
    </b-modal>

这是我的模态,就在我的按钮上方:

this is my modal and just above I have my button :

<button class="btn btn-xs btn-success" @click.stop="details(row.item,row.index,$event.target)">
        <span class="glyphicon glyphicon-search"></span>
      </button>

和下面的

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆