From 72e69eea5b884b08e03f984ac18858f5c022793b Mon Sep 17 00:00:00 2001 From: Blesilda Ramirez Date: Wed, 4 Sep 2024 02:22:23 +0800 Subject: [PATCH] pkp/pkp-lib#9890 Add command on root items to navigate to links --- src/composables/useSideMenu.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/composables/useSideMenu.js b/src/composables/useSideMenu.js index 7e2b6aee2..caddf62ea 100644 --- a/src/composables/useSideMenu.js +++ b/src/composables/useSideMenu.js @@ -64,6 +64,12 @@ export function useSideMenu(_items, _activeItemKey = '', _expandedKeys = {}) { item.items = mapItems(_item.items, level + 1); } + if (level === 1 && item.link && !_item.items) { + item.command = () => { + window.location.href = item.link; + }; + } + result.push(item); });