Skip to content

Commit

Permalink
Merge pull request #3040 from nextcloud/allow-listitems-to-have-exter…
Browse files Browse the repository at this point in the history
…nal-links

Allow ListItem components to link to external links
  • Loading branch information
artonge committed Aug 18, 2022
2 parents 739eccd + 5ba557d commit 28a1be5
Showing 1 changed file with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions src/components/ListItem/ListItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<ul style="width: 350px;">
<listItem
:title="'Title of the element'"
:counter-number=1
:counter-number="1"
:compact="true" >
<template #icon>
<div class="icon-edit" />
Expand All @@ -151,7 +151,7 @@
</listItem>
<listItem
:title="'Title of the element'"
:counter-number=3
:counter-number="3"
:compact="true" >
<template #icon>
<div class="icon-edit" />
Expand All @@ -170,11 +170,15 @@
</listItem>
<listItem
:title="'Title of the element'"
:counter-number=4
:compact="true" >
:compact="true"
:counter-number="4"
href="https://nextcloud.com">
<template #icon>
<div class="icon-edit" />
</template>
<template #subtitle>
This one is with an external link
</template>
</listItem>
</ul>
```
Expand All @@ -187,7 +191,9 @@
<a :id="anchorId"
ref="list-item"
:class="{ 'list-item--active' : active }"
href="#"
:href="href"
target="_blank"
rel="noopener noreferrer"
class="list-item"
:aria-label="linkAriaLabel"
@mouseover="handleMouseover"
Expand Down Expand Up @@ -319,6 +325,14 @@ export default {
default: '',
},
/**
* The value for the external link
*/
href: {
type: String,
default: '#',
},
/**
* Id for the <a> element
*/
Expand Down

0 comments on commit 28a1be5

Please sign in to comment.