Skip to content

Commit

Permalink
Merge pull request #2720 from nextcloud/fix/2707/appnavigationnew-icon
Browse files Browse the repository at this point in the history
Add icon slot to AppNavigationNew component
  • Loading branch information
marcoambrosini authored Jun 3, 2022
2 parents ad34c3f + 06a0504 commit 47cc565
Showing 1 changed file with 33 additions and 15 deletions.
48 changes: 33 additions & 15 deletions src/components/AppNavigationNew/AppNavigationNew.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,55 @@
-
-->

<docs>
### Usage

```
<template>
<AppNavigationNew text="New Element">
<template #icon>
<Plus :size="20" decorative />
</template>
</AppNavigationNew>
</template>
<script>
import Plus from 'vue-material-design-icons/Plus'

export default {
components: {
Plus,
},
}
</script>
```
</docs>

<template>
<div class="app-navigation-new">
<button :id="buttonId"
:class="buttonClass"
<Button :id="buttonId"
:disabled="disabled"
type="button"
@click="$emit('click')">
<template #icon>
<slot name="icon" />
</template>
{{ text }}
</button>
</Button>
</div>
</template>

<script>
import Button from '../Button/index.js'

export default {
components: {
Button,
},
props: {
buttonId: {
type: String,
required: false,
default: '',
},
buttonClass: {
type: [String, Array, Object],
required: false,
default: '',
},
disabled: {
type: Boolean,
required: false,
Expand All @@ -64,13 +88,7 @@ export default {
display: block;
padding: 10px;
button {
display: inline-block;
width: 100%;
padding: 10px;
padding-left: 34px;
background-position: 10px center;
text-align: left;
margin: 0;
}
}
</style>

0 comments on commit 47cc565

Please sign in to comment.