Skip to content

Commit

Permalink
feat(Slideover): add close button in header (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
smarroufin committed Jun 24, 2022
1 parent aecfef2 commit 2f90ce2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/components/overlays/Slideover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,12 @@
leave-from="translate-x-0"
:leave-to="side === 'left' ? '-translate-x-full' : 'translate-x-full'"
>
<DialogPanel class="relative flex-1 flex flex-col w-full max-w-md u-bg-white focus:outline-none">
<DialogPanel class="relative flex-1 flex flex-col w-full max-w-md u-bg-white focus:outline-none" :class="panelClass">
<div v-if="$slots.header" class="border-b u-border-gray-200">
<div class="flex items-center justify-between px-4 sm:px-6 h-16">
<slot name="header" />
</div>
</div>

<slot />
</DialogPanel>
</TransitionChild>
Expand All @@ -56,6 +55,10 @@ const props = defineProps({
type: String,
default: 'left',
validator: (value: string) => ['left', 'right'].includes(value)
},
panelClass: {
type: String,
default: 'max-w-md'
}
})
const emit = defineEmits(['update:modelValue'])
Expand Down

0 comments on commit 2f90ce2

Please sign in to comment.