From 601b37505e31cdbbd32b1a2af37b5ceaca6d34d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raimund=20Schl=C3=BC=C3=9Fler?= Date: Fri, 17 Feb 2023 12:44:31 +0100 Subject: [PATCH] Use router-link slot in NcAppNavigationItem MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Raimund Schlüßler --- .../NcAppNavigationItem.vue | 204 +++++++++--------- src/components/NcVNodes/NcVNodes.vue | 17 +- 2 files changed, 108 insertions(+), 113 deletions(-) diff --git a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue index e5840da78e..2ae4cb854b 100644 --- a/src/components/NcAppNavigationItem/NcAppNavigationItem.vue +++ b/src/components/NcAppNavigationItem/NcAppNavigationItem.vue @@ -209,99 +209,104 @@ Just set the `pinned` prop. 'app-navigation-entry--collapsible': collapsible, }" class="app-navigation-entry-wrapper"> - - - - - - -
- - + +
+ + + + + +
+ + +
+ + {{ nameTitleFallback }} + +
+ +
+
+ + + +
+
+ {{ nameTitleFallback }} +
- - {{ nameTitleFallback }} - -
- -
- - - - -
-
- {{ nameTitleFallback }} -
-
- -
-
- -
- - - + +
+
+ +
+ - {{ editLabel }} - - - - - - -
+ + + {{ editLabel }} + + + + + +
+
- - - + + +
+
    @@ -315,6 +320,7 @@ import { directive as ClickOutside } from 'v-click-outside' import NcActions from '../NcActions/index.js' import NcActionButton from '../NcActionButton/index.js' import NcLoadingIcon from '../NcLoadingIcon/index.js' +import NcVNodes from '../NcVNodes/index.js' import NcAppNavigationIconCollapsible from './NcAppNavigationIconCollapsible.vue' import isMobile from '../../mixins/isMobile/index.js' import NcInputConfirmCancel from './NcInputConfirmCancel.vue' @@ -330,9 +336,10 @@ export default { components: { NcActions, NcActionButton, - NcLoadingIcon, NcAppNavigationIconCollapsible, NcInputConfirmCancel, + NcLoadingIcon, + NcVNodes, Pencil, Undo, }, @@ -598,25 +605,6 @@ export default { return false }, - // This is used to decide which outer element type to use - navElement() { - if (this.to && !this.href) { - return { - is: 'router-link', - tag: 'div', - to: this.to, - exact: this.exact, - } - } - return { - is: 'div', - } - }, - - isActive() { - return this.to && this.$route === this.to - }, - editButtonAriaLabel() { return this.editLabel ? this.editLabel : t('Edit item') }, diff --git a/src/components/NcVNodes/NcVNodes.vue b/src/components/NcVNodes/NcVNodes.vue index bc2262494c..bbdb40c2f5 100644 --- a/src/components/NcVNodes/NcVNodes.vue +++ b/src/components/NcVNodes/NcVNodes.vue @@ -1,5 +1,5 @@