Hide modal footer when empty, changed slot names for good code practice

This commit is contained in:
2024-06-09 22:32:36 +02:00
parent daa469d5e5
commit c8e5daf6cf
2 changed files with 7 additions and 10 deletions

View File

@ -2,14 +2,14 @@
<Teleport to="body">
<div class="modal-container" :style="{ top: y + 'px', left: x + 'px' }" v-if="isModalOpenRef">
<div class="modal-header" @mousedown="startDrag">
<slot name="modal-header" />
<slot name="modalHeader" />
<button @click="close" v-if="closable"><img draggable="false" src="/assets/icons/close-button-white.svg" /></button>
</div>
<div class="modal-body">
<slot name="modal-body" />
<slot name="modalBody" />
</div>
<div class="modal-footer">
<slot name="modal-footer" />
<div v-if="$slots.modalFooter" class="modal-footer">
<slot name="modalFooter" />
</div>
</div>
</Teleport>
@ -88,6 +88,7 @@ onUnmounted(() => {
removeEventListener('mousemove', drag)
removeEventListener('mouseup', stopDrag)
})
</script>
<style lang="scss">