From 370031159bf9cf8106b974520dff244d738d62f1 Mon Sep 17 00:00:00 2001 From: Norman F Date: Mon, 30 Sep 2024 17:01:04 +0200 Subject: [PATCH] feat(Table): Add contextmenu handling --- .../examples/TableExampleContextmenu.vue | 67 +++++++++++++++++++ docs/content/2.components/table.md | 16 +++++ src/runtime/components/data/Table.vue | 12 +++- 3 files changed, 94 insertions(+), 1 deletion(-) create mode 100644 docs/components/content/examples/TableExampleContextmenu.vue diff --git a/docs/components/content/examples/TableExampleContextmenu.vue b/docs/components/content/examples/TableExampleContextmenu.vue new file mode 100644 index 0000000000..8a2da62e14 --- /dev/null +++ b/docs/components/content/examples/TableExampleContextmenu.vue @@ -0,0 +1,67 @@ + + + diff --git a/docs/content/2.components/table.md b/docs/content/2.components/table.md index e2991ca84a..2bbfd8ea2b 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 24457f32c6..7e3d12c995 100644 --- a/src/runtime/components/data/Table.vue +++ b/src/runtime/components/data/Table.vue @@ -71,7 +71,7 @@