[Vuejs]-Vue Ant Design Modal appears twice

1👍

From what I can infer, this is happening because the dialogs don’t have a unique value as v-model. So, whenever visible is set to true all the dialogs are appearing simultaneously. Please check by assigning unique value in v-model for each dialog.

0👍

I solved it, by putting the <a-model> outside of the <span> attribute:

<a-table :columns="columns" :dataSource="data" :rowSelection="rowSelection" bordered rowKey="id">
  <span slot="operation" slot-scope="text, record">
    <a @click="showModal(record)">Details</a>

  </span>
</a-table>

<a-modal title="Bestell-Details" width="1000px"  v-model="visible" @ok="handleOk">
  <HelloWorld v-bind:order=selectedOrder></HelloWorld>
</a-modal>


showModal(key) {
        this.visible = true;
        this.selectedOrder = key;
      },
👤farahm

Leave a comment