Skip to content

Commit

Permalink
Merge pull request #5680 from nextcloud-libraries/backport/5679/next
Browse files Browse the repository at this point in the history
[next] feat(NcDialogButton): Allow to pass `disabled` prop
  • Loading branch information
susnux authored Jun 8, 2024
2 parents c9ed9c3 + bea4eea commit 4a179e3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/NcDialogButton/NcDialogButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ Dialog button component used by NcDialog in the actions slot to display the butt
</docs>

<template>
<NcButton :aria-label="label" :type="type" @click="handleClick">
<NcButton :aria-label="label"
:disabled="disabled"
:type="type"
@click="handleClick">
{{ label }}
<template #icon>
<!-- @slot Allow to set a custom icon for the button -->
Expand Down Expand Up @@ -86,6 +89,14 @@ export default defineComponent({
default: 'secondary',
validator: (type) => typeof type === 'string' && ['primary', 'secondary', 'error', 'warning', 'success'].includes(type),
},
/**
* If the button should be shown as disabled
*/
disabled: {
type: Boolean,
default: false,
},
},
emits: ['click'],
Expand Down

0 comments on commit 4a179e3

Please sign in to comment.