From bdcfe3c74cf0bb77e8f3c4e1c3918364a4541691 Mon Sep 17 00:00:00 2001 From: fenn-cs Date: Wed, 6 Dec 2023 12:03:09 +0100 Subject: [PATCH] Add target prop for NcListItem The component user should have full control over what tab they want the link to open in, if any. Signed-off-by: fenn-cs --- src/components/NcListItem/NcListItem.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/NcListItem/NcListItem.vue b/src/components/NcListItem/NcListItem.vue index d487c023fd..158ebc2715 100644 --- a/src/components/NcListItem/NcListItem.vue +++ b/src/components/NcListItem/NcListItem.vue @@ -316,7 +316,7 @@ ` element */ @@ -585,7 +590,12 @@ export default { computedActionsAriaLabel() { return this.actionsAriaLabel || t('Actions for item with name "{name}"', { name: this.name }) }, - + computedTarget() { + if (this.target !== undefined && this.target !== null) { + return this.target + } + return this.href === '#' ? undefined : '_blank' + }, }, watch: {