context menu submenu support

This commit is contained in:
Jan Prochazka
2021-06-05 08:14:03 +02:00
parent 6b8bf8161e
commit 50b90e181a
3 changed files with 69 additions and 6 deletions

View File

@@ -51,7 +51,8 @@
label: 'Export',
isExport: true,
},
electron && {
// electron &&
{
label: 'Quick export',
isQuickExport: true,
},
@@ -394,6 +395,23 @@
.filter(x => x)
.map(menu => {
if (menu.divider) return menu;
if (menu.isQuickExport) {
return {
text: menu.label,
submenu: [
{
text: 'CSV file',
isQuickExport: true,
},
{
text: 'Excel',
isQuickExport: true,
},
],
};
}
return {
text: menu.label,
onClick: async () => {