TinkerBel
TinkerBel

Reputation: 135

Is there a right click event on vue-good-table rows to show a context menu?

According to what I see in vue-good-table documentationn there's no right-click event exist, only click, dbl-click, mouseEnter..

I need to have a context-menu opened on right-click for each row. Do someone have any suggestions how to solve the problem?

Upvotes: 3

Views: 3238

Answers (1)

Boussadjra Brahim
Boussadjra Brahim

Reputation: 1

You could use Custom row template and add @contextmenu event as follows:

<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>

for more clarification check this code

Upvotes: 5

Related Questions