2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/ui/components/Modal/Modal.vue
Faris Ansari 8f2c48c3df Modal
- Simplify modal plugin
- Support multiple stacked modals in a modal container
- Add formModal plugin
2018-07-10 19:05:43 +05:30

52 lines
1.2 KiB
Vue

<template>
<div :class="['modal fade show d-block']"
tabindex="-1" role="dialog" aria-labelledby="frappe-modal-label" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content shadow">
<div class="modal-header">
<h5 class="modal-title">{{ title }}</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close" @click="closeModal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body modal-height">
<component :is="component" v-bind="props" v-on="events"/>
</div>
<div class="modal-footer">
<f-button secondary @click="closeModal">{{ _('Close') }}</f-button>
</div>
</div>
</div>
</div>
</template>
<script>
export default {
props: {
title: {
type: String,
default: "Modal Title"
},
component: {
type: Object
},
props: {
type: Object
},
events: {
type: Object
}
},
methods: {
closeModal() {
this.$emit('close-modal');
}
}
};
</script>
<style scoped>
.modal-height {
max-height: 80vh;
overflow: auto;
}
</style>