【问题标题】:Vuetify data-table supress click on row in cellVuetify 数据表禁止单击单元格中的行
【发布时间】:2020-03-18 15:48:04
【问题描述】:

如果我单击 vuetiy v-data-table 中的一行,我想显示一个对话框。 此外,我在此表中有一个列,其中有一个我也想使用的按钮。

如果我单击此按钮,则单击该行并注册该按钮。两个函数都被执行。有没有办法不执行对行的点击?

<v-data-table :headers="headers" :items="items" @click:row="openRecipe">
  <template v-slot:item.actions="{ item }">
    <v-icon
     small
     @click="edit(item)"
    >mdi-pencil</v-icon>
  </template>
</v-data-table>

【问题讨论】:

    标签: vue.js vuetify.js


    【解决方案1】:

    您应该像这样将stop(停止传播点击事件)添加到按钮的点击侦听器中:@click.stop="edit(item)"。您可能还想添加prevent@click.stop.prevent;

    更多关于here

    【讨论】:

      猜你喜欢
      • 2021-02-21
      • 1970-01-01
      • 2022-08-06
      • 1970-01-01
      • 1970-01-01
      • 2014-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多