2018-08-11 07:47:10 +02:00
|
|
|
<template>
|
2024-09-10 21:05:12 +02:00
|
|
|
<base-modal :show="show" @close="$emit('close')">
|
|
|
|
<template #content>
|
|
|
|
<p v-if="title" class="title is-4" v-text="title" />
|
|
|
|
<slot name="modal-content" />
|
|
|
|
</template>
|
|
|
|
<template #footer>
|
|
|
|
<a class="card-footer-item has-text-dark" @click="$emit('close')">
|
|
|
|
<mdicon class="icon" name="cancel" size="16" />
|
|
|
|
<span class="is-size-7" v-text="close_action" />
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
v-if="delete_action"
|
|
|
|
class="card-footer-item has-background-danger has-text-white has-text-weight-bold"
|
|
|
|
@click="$emit('delete')"
|
|
|
|
>
|
|
|
|
<mdicon class="icon" name="delete" size="16" />
|
|
|
|
<span class="is-size-7" v-text="delete_action" />
|
|
|
|
</a>
|
|
|
|
<a
|
|
|
|
v-if="ok_action"
|
|
|
|
class="card-footer-item has-background-info has-text-white has-text-weight-bold"
|
|
|
|
@click="$emit('ok')"
|
|
|
|
>
|
|
|
|
<mdicon class="icon" name="check" size="16" />
|
|
|
|
<span class="is-size-7" v-text="ok_action" />
|
|
|
|
</a>
|
|
|
|
</template>
|
|
|
|
</base-modal>
|
2018-08-11 07:47:10 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2024-09-10 21:05:12 +02:00
|
|
|
import BaseModal from '@/components/BaseModal.vue'
|
|
|
|
|
2018-08-11 07:47:10 +02:00
|
|
|
export default {
|
|
|
|
name: 'ModalDialog',
|
2024-09-10 21:05:12 +02:00
|
|
|
components: { BaseModal },
|
2024-02-27 17:18:58 +01:00
|
|
|
props: {
|
2024-04-23 21:44:35 +02:00
|
|
|
close_action: { default: '', type: String },
|
2024-02-28 13:10:08 +01:00
|
|
|
delete_action: { default: '', type: String },
|
|
|
|
ok_action: { default: '', type: String },
|
2024-02-27 17:18:58 +01:00
|
|
|
show: Boolean,
|
2024-02-28 13:10:08 +01:00
|
|
|
title: { required: true, type: String }
|
2024-02-27 17:18:58 +01:00
|
|
|
},
|
2024-09-09 21:03:59 +02:00
|
|
|
emits: ['delete', 'close', 'ok'],
|
|
|
|
watch: {
|
|
|
|
show() {
|
|
|
|
const { classList } = document.querySelector('html')
|
|
|
|
if (this.show) {
|
|
|
|
classList.add('is-clipped')
|
|
|
|
} else {
|
|
|
|
classList.remove('is-clipped')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2018-08-11 07:47:10 +02:00
|
|
|
}
|
|
|
|
</script>
|