This repository has been archived on 2024-02-08. You can view files and clone it, but cannot push or open issues or pull requests.
2018-09-12 06:22:17 +00:00
|
|
|
<template>
|
|
|
|
<transition name="modal">
|
|
|
|
<div class="modal-mask">
|
2021-01-21 22:33:16 +00:00
|
|
|
<div class="modal-container" @click.self.prevent.stop="$emit('close')">
|
2021-01-30 16:17:04 +00:00
|
|
|
<div class="modal-content" :class="{'has-overflow': overflow, 'is-wide': wide}">
|
2021-01-16 21:15:48 +00:00
|
|
|
<slot>
|
2021-01-17 17:57:57 +00:00
|
|
|
<div class="header">
|
|
|
|
<slot name="header"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<slot name="text"></slot>
|
|
|
|
</div>
|
|
|
|
<div class="actions">
|
|
|
|
<x-button
|
|
|
|
@click="$emit('close')"
|
|
|
|
type="tertary"
|
|
|
|
class="has-text-danger"
|
|
|
|
>
|
|
|
|
Cancel
|
|
|
|
</x-button>
|
|
|
|
<x-button
|
|
|
|
@click="$emit('submit')"
|
|
|
|
type="primary"
|
|
|
|
:shadow="false"
|
|
|
|
>
|
|
|
|
Do it!
|
|
|
|
</x-button>
|
|
|
|
</div>
|
2021-01-16 21:15:48 +00:00
|
|
|
</slot>
|
2018-09-12 06:22:17 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</transition>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2020-09-05 20:35:52 +00:00
|
|
|
export default {
|
|
|
|
name: 'modal',
|
|
|
|
mounted: function () {
|
|
|
|
document.addEventListener('keydown', (e) => {
|
|
|
|
// Close the model when escape is pressed
|
|
|
|
if (e.keyCode === 27) {
|
|
|
|
this.$emit('close')
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
2021-01-21 22:33:16 +00:00
|
|
|
props: {
|
|
|
|
overflow: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-30 16:17:04 +00:00
|
|
|
wide: {
|
|
|
|
type: Boolean,
|
|
|
|
default: false,
|
|
|
|
},
|
2021-01-21 22:33:16 +00:00
|
|
|
},
|
2020-09-05 20:35:52 +00:00
|
|
|
}
|
2018-09-12 06:22:17 +00:00
|
|
|
</script>
|