Skip to content

Commit

Permalink
Add target prop for NcListItem
Browse files Browse the repository at this point in the history
The component user should have full control over what tab
 they want the link to open in, if any.

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
  • Loading branch information
Fenn-CS committed Dec 6, 2023
1 parent 8008811 commit fccba1f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/NcListItem/NcListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
<a :id="anchorId"
ref="list-item"
:href="routerLinkHref || href"
:target="href === '#' ? undefined : '_blank'"
:target="target || (href === '#' ? undefined : '_blank')"
:rel="href === '#' ? undefined : 'noopener noreferrer'"
class="list-item"
:aria-label="linkAriaLabel"
Expand Down Expand Up @@ -470,6 +470,11 @@ export default {
default: '#',
},
target: {
type: String,
default: '',
},
/**
* Id for the `<a>` element
*/
Expand Down Expand Up @@ -585,7 +590,6 @@ export default {
computedActionsAriaLabel() {
return this.actionsAriaLabel || t('Actions for item with name "{name}"', { name: this.name })
},
},
watch: {
Expand Down

0 comments on commit fccba1f

Please sign in to comment.