3

根据我看到vue-good-table documentationn的没有right-click事件存在,只有单击,dbl-click,mouseEnter ..

我需要为每一行打开一个上下文菜单。right-click有人对如何解决问题有任何建议吗?

4

1 回答 1

5

您可以按如下方式使用Custom row template和添加事件:@contextmenu

<vue-good-table :columns="columns" :rows="rows">
  <template slot="table-row" slot-scope="props">

      <div @contextmenu.prevent="openMenu($event,props.row)" >
           {{props.formattedRow[props.column.field]}}
       </div> 

  </template>
</vue-good-table>

有关更多说明,请检查此代码

于 2018-12-30T12:34:17.840 回答