类星体框架:从Q-table行打开Q-Dialog,打开表中每个行的对话框
首先,对不起,英语不好,我也在改善这一点。 您好,我在将VUEJS与类星体框架一起使用时很新。我想以模态(q-dialog)的一行打开详细信息,我有一个要编辑和删除的按钮,但是用来查看一个寄存器中的详细信息的打开按钮已将其附加到该行中的名称,作为链接。 当我单击它时,它将打开对话框,是的。但它可以为表中的每个寄存器打开它。我在每次点击时都进行了与数据库的连接的日志,并且对表中的每个寄存器都重复。
我的代码。
<q-table
table-header-class="bg-grey-3 text-grey-9 "
:rows="rows"
:columns="columns"
:row-key="columns[0].name"
:separator="separator"
:filter="search"
>
<template v-slot:body-cell-usuario="props">
<q-td :props="props">
<div>
<q-btn @click="modalDetalle = true"> {{ props.row.usuario }}</q-btn>
</div>
<q-dialog v-model="modalDetalle">
<component :is="verDetalle" :id="props.key" @reload="getStatus" />
</q-dialog>
</q-td>
</template>
first of all, sorry for bad english, I'm improving that too.
Hello, i'm quite new in using vuejs with quasar framework. I want to open the details from a row in a modal (q-dialog), I have a button to edit and delete, but the open button used to see the details from one register is attached to the name in the row as a link.
when I click on it, it opens the dialog, yay. but it opens it for every register in the table. I made logs for the connection to database on each click and it repeats for every register in table.
my code.
<q-table
table-header-class="bg-grey-3 text-grey-9 "
:rows="rows"
:columns="columns"
:row-key="columns[0].name"
:separator="separator"
:filter="search"
>
<template v-slot:body-cell-usuario="props">
<q-td :props="props">
<div>
<q-btn @click="modalDetalle = true"> {{ props.row.usuario }}</q-btn>
</div>
<q-dialog v-model="modalDetalle">
<component :is="verDetalle" :id="props.key" @reload="getStatus" />
</q-dialog>
</q-td>
</template>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
非常简单,请
参考
此codepen。https://codepen.io/pratik__007/pen/pen/pen/pen/dydzyey
It's very easy please
refer
this codepen.https://codepen.io/Pratik__007/pen/dydZyEY