From 95867428a822a858c4e26fb935deb0bd1e26e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Gr=C3=B6ger?= Date: Sun, 18 Apr 2021 23:43:16 +0200 Subject: [PATCH] [core] draggable shortcutlinks --- src/components/navigation/ShortcutLink.vue | 14 +++--- src/layouts/MainLayout.vue | 52 +++++++++++----------- src/pages/Login.vue | 14 ++++-- 3 files changed, 44 insertions(+), 36 deletions(-) diff --git a/src/components/navigation/ShortcutLink.vue b/src/components/navigation/ShortcutLink.vue index 79f35f1..f8ec670 100644 --- a/src/components/navigation/ShortcutLink.vue +++ b/src/components/navigation/ShortcutLink.vue @@ -1,7 +1,7 @@ @@ -21,17 +21,17 @@ export default defineComponent({ context: { type: Boolean, default: false, - } + }, }, emits: { - deleteShortcut: (val: FG_Plugin.MenuLink| FG_Plugin.Shortcut) => val.link + deleteShortcut: (val: FG_Plugin.MenuLink | FG_Plugin.Shortcut) => val.link, }, - setup(props, {emit}) { + setup(props, { emit }) { const isGranted = computed(() => hasPermissions(props.shortcut.permissions || [])); function deleteShortcut() { - emit('deleteShortcut', props.shortcut) + emit('deleteShortcut', props.shortcut); } - return { isGranted, deleteShortcut}; + return { isGranted, deleteShortcut }; }, }); diff --git a/src/layouts/MainLayout.vue b/src/layouts/MainLayout.vue index f6ec065..a888aa6 100644 --- a/src/layouts/MainLayout.vue +++ b/src/layouts/MainLayout.vue @@ -14,8 +14,10 @@ - {{ notifications.length }} + + + {{ notifications.length }} + Keine neuen Benachrichtigungen - - + + + @@ -64,13 +59,6 @@ :entry="entry" @add-short-cut="addShortcut" /> - draggable; const essentials: FG_Plugin.MenuLink[] = [ { title: 'Über Flaschengeist', @@ -106,7 +104,7 @@ const essentials: FG_Plugin.MenuLink[] = [ export default defineComponent({ name: 'MainLayout', - components: { EssentialExpansionLink, EssentialLink, ShortcutLink, Notification }, + components: { EssentialExpansionLink, EssentialLink, ShortcutLink, Notification, drag }, setup() { const router = useRouter(); const mainStore = useMainStore(); @@ -171,8 +169,8 @@ export default defineComponent({ const shortCuts = computed({ get: () => mainStore.shortcuts, set: (val: Array) => { - console.log('hier bin ich', val); mainStore.shortcuts = val; + void mainStore.setShortcuts(); }, }); @@ -185,7 +183,6 @@ export default defineComponent({ } function deleteShortcut(val: FG_Plugin.MenuLink) { - console.log('deleteShortcut'); const idx = shortCuts.value.findIndex((a: FG_Plugin.MenuLink) => a.link === val.link); if (idx > -1) { shortCuts.value.splice(idx, 1); @@ -212,3 +209,8 @@ export default defineComponent({ }, }); + diff --git a/src/pages/Login.vue b/src/pages/Login.vue index 68bde36..6ebd442 100644 --- a/src/pages/Login.vue +++ b/src/pages/Login.vue @@ -36,9 +36,15 @@
- +
- +
@@ -78,7 +84,7 @@ export default defineComponent({ const password = ref(''); const server = ref(api.defaults.baseURL); const visible = ref(false); - const $q = useQuasar() + const $q = useQuasar(); function openServerSettings() { visible.value = !visible.value; @@ -152,7 +158,7 @@ export default defineComponent({ server, userid, visible, - $q + $q, }; }, });