diff --git a/src/components/TopBar.vue b/src/components/TopBar.vue index 27d2a33..6433609 100644 --- a/src/components/TopBar.vue +++ b/src/components/TopBar.vue @@ -18,6 +18,10 @@ watch(() => route.meta, (newVal, oldVal) => { const toggle = (event) => { menu.value.toggle(event); }; +const logout = () => { + userStore.logout(); +}; + const menu = ref(); const localActions = [{ @@ -30,6 +34,11 @@ const localActions = [{ needsAuth: true, }]; const allActions = [...userActions, ...localActions]; +allActions.map((item) => { + if (item.cmd === 'logout') { + item.command = logout; + } +}); const items = ref(allActions);