forked from Ivasoft/geovisio-website
87 lines
1.6 KiB
Vue
87 lines
1.6 KiB
Vue
<template>
|
|
<div
|
|
class="modal fade"
|
|
id="bs-modal"
|
|
tabindex="-1"
|
|
role="dialog"
|
|
aria-labelledby="exampleModalCenterTitle"
|
|
aria-hidden="true"
|
|
>
|
|
<div class="modal-dialog modal-dialog-centered" role="document">
|
|
<div class="modal-content">
|
|
<button class="close-button" type="button" @click="bsModal.hide()">
|
|
<i class="bi bi-x-circle-fill"></i>
|
|
</button>
|
|
<div class="modal-header">
|
|
<h5>{{ title }}</h5>
|
|
</div>
|
|
<div class="modal-body">
|
|
<slot name="body"></slot>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { ref, onMounted } from 'vue'
|
|
import { Modal } from 'bootstrap'
|
|
let bsModal = ref()
|
|
|
|
defineProps({
|
|
title: {
|
|
type: String,
|
|
default: ''
|
|
}
|
|
})
|
|
|
|
onMounted(() => {
|
|
bsModal.value = new Modal(document.getElementById('bs-modal'), {})
|
|
})
|
|
function displayModal() {
|
|
bsModal.value.show()
|
|
}
|
|
|
|
function closeModal() {
|
|
bsModal.value.hide()
|
|
}
|
|
defineExpose({ show: displayModal, close: closeModal })
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
ul {
|
|
padding: 0;
|
|
}
|
|
.modal {
|
|
background: rgba(10, 31, 105, 0.6);
|
|
}
|
|
.modal-content {
|
|
border-radius: toRem(1.5);
|
|
}
|
|
.modal-body {
|
|
overflow-y: auto;
|
|
color: var(--grey-semi-dark);
|
|
}
|
|
.modal-header {
|
|
color: var(--blue-dark);
|
|
}
|
|
.close-button {
|
|
font-size: toRem(3);
|
|
width: fit-content;
|
|
border-radius: 50%;
|
|
border: none;
|
|
background: transparent;
|
|
position: absolute;
|
|
right: toRem(-4);
|
|
top: toRem(-4);
|
|
color: var(--white);
|
|
}
|
|
|
|
@media (max-width: toRem(50)) {
|
|
.close-button {
|
|
right: toRem(0);
|
|
top: toRem(-5);
|
|
}
|
|
}
|
|
</style>
|