2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2025-01-23 09:31:51 +01:00
|
|
|
<transition name="fade">
|
|
|
|
<div v-if="show" class="modal is-active">
|
|
|
|
<div class="modal-background" @click="$emit('close')" />
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-content">
|
2025-02-04 22:00:48 +01:00
|
|
|
<slot name="content" />
|
2025-01-23 09:31:51 +01:00
|
|
|
</div>
|
|
|
|
<footer class="card-footer is-clipped">
|
2025-02-04 22:00:48 +01:00
|
|
|
<slot name="footer" />
|
2025-01-23 09:31:51 +01:00
|
|
|
</footer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'ModalDialog',
|
2024-02-27 17:18:58 +01:00
|
|
|
props: {
|
2025-02-04 22:00:48 +01:00
|
|
|
show: Boolean
|
2024-02-27 17:18:58 +01:00
|
|
|
},
|
2025-02-04 22:00:48 +01:00
|
|
|
emits: ['close'],
|
|
|
|
watch: {
|
|
|
|
show(value) {
|
|
|
|
const { classList } = document.querySelector('html')
|
|
|
|
if (value) {
|
|
|
|
classList.add('is-clipped')
|
|
|
|
} else {
|
|
|
|
classList.remove('is-clipped')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
</script>
|
2025-01-23 09:31:51 +01:00
|
|
|
|
2025-02-04 22:00:48 +01:00
|
|
|
<style scoped>
|
|
|
|
.fade-leave-active {
|
|
|
|
transition: opacity 0.2s ease;
|
|
|
|
}
|
|
|
|
.fade-enter-active {
|
|
|
|
transition: opacity 0.5s ease;
|
|
|
|
}
|
|
|
|
.fade-enter-from,
|
|
|
|
.fade-leave-to {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
.fade-enter-to,
|
|
|
|
.fade-leave-from {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
</style>
|