Skip to content

Commit

Permalink
feat(v-modal): new props: hide-header and hide-footer
Browse files Browse the repository at this point in the history
  • Loading branch information
gravitano committed Sep 29, 2021
1 parent 93ff41d commit da6476f
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/components/VModal/VModal.vue
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<script lang="ts">
export default {
// inheritAttrs: false
};
</script>

<script setup lang="ts">
import {ref, toRefs, watch} from 'vue';
import {
Expand All @@ -22,6 +28,8 @@ interface Props {
footerClass?: string;
modalClass?: string;
loading?: boolean;
hideHeader?: boolean;
hideFooter?: boolean;
}
const props = withDefaults(defineProps<Props>(), {
Expand All @@ -38,6 +46,8 @@ const props = withDefaults(defineProps<Props>(), {
footerClass: '',
modalClass: '',
boolean: false,
hideHeader: false,
hideFooter: false,
});
const emit = defineEmits(['update:modelValue', 'confirm', 'close', 'open']);
Expand Down Expand Up @@ -130,6 +140,7 @@ const onConfirm = () => {
:class="modalClass"
>
<DialogTitle
v-if="!hideHeader"
as="h3"
class="text-lg font-medium leading-6 text-gray-900"
:class="headerClass"
Expand All @@ -142,8 +153,17 @@ const onConfirm = () => {
<slot />
</div>

<div class="mt-6 flex justify-end gap-2" :class="footerClass">
<slot name="footer">
<div
v-if="!hideFooter"
class="mt-6 flex justify-end gap-2"
:class="footerClass"
>
<slot
name="footer"
:loading="loading"
:confirm-props="confirmProps"
:on-confirm="onConfirm"
>
<v-btn
v-if="confirm"
:color="confirmColor"
Expand Down

0 comments on commit da6476f

Please sign in to comment.