Skip to content

Commit

Permalink
Merge pull request #5679 from nextcloud-libraries/feat/nc-dialog-butt…
Browse files Browse the repository at this point in the history
…on-disabled

feat(NcDialogButton): Allow to pass `disabled` prop
  • Loading branch information
susnux authored Jun 8, 2024
2 parents e57e446 + eca8fea commit c8e500a
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 c8e500a

Please sign in to comment.