diff --git a/docs/components/content/examples/TableExampleContextmenu.vue b/docs/components/content/examples/TableExampleContextmenu.vue new file mode 100644 index 0000000000..ac49db3bdf --- /dev/null +++ b/docs/components/content/examples/TableExampleContextmenu.vue @@ -0,0 +1,66 @@ + + + diff --git a/docs/content/2.components/table.md b/docs/content/2.components/table.md index a3b421fe61..8fbe24febe 100644 --- a/docs/content/2.components/table.md +++ b/docs/content/2.components/table.md @@ -285,6 +285,22 @@ componentProps: --- :: +### Contextmenu + +Use the `contextmenu` listener on your Table to make the rows righ-clickable. The function will receive the original event as the first argument and the row as the second argument. + +You can use this to open a [ContextMenu](/components/context-menu) for that row. + +::component-example{class="grid"} +--- +extraClass: 'overflow-hidden' +padding: false +component: 'table-example-contextmenu' +componentProps: + class: 'flex-1 flex-col overflow-hidden' +--- +:: + ### Searchable You can easily use the [Input](/components/input) component to filter the rows. diff --git a/src/runtime/components/data/Table.vue b/src/runtime/components/data/Table.vue index be766500b1..1fb1e8c9ef 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -77,7 +77,7 @@