类星体框架:从Q-table行打开Q-Dialog,打开表中每个行的对话框

发布于 2025-01-31 12:33:08 字数 887 浏览 0 评论 0原文

首先,对不起,英语不好,我也在改善这一点。 您好,我在将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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

忆依然 2025-02-07 12:33:08

非常简单,请参考此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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文