feat(Slideover): add prevent-close prop

This commit is contained in:
Benjamin Canac
2023-07-12 15:59:11 +02:00
parent 2cc5c0d810
commit d15e8163e7
9 changed files with 265 additions and 32 deletions

View File

@@ -1,6 +1,6 @@
<template>
<TransitionRoot as="template" :appear="appear" :show="isOpen">
<HDialog :class="[ui.wrapper, { 'justify-end': side === 'right' }]" @close="close">
<HDialog :class="[ui.wrapper, { 'justify-end': side === 'right' }]" @close="(e) => !preventClose && close(e)">
<TransitionChild v-if="overlay" as="template" :appear="appear" v-bind="ui.overlay.transition">
<div :class="[ui.overlay.base, ui.overlay.background]" />
</TransitionChild>
@@ -55,6 +55,10 @@ export default defineComponent({
type: Boolean,
default: true
},
preventClose: {
type: Boolean,
default: false
},
ui: {
type: Object as PropType<Partial<typeof appConfig.ui.slideover>>,
default: () => appConfig.ui.slideover