add reusable modal component
This commit is contained in:
parent
093d785fbf
commit
07ec18fe11
1 changed files with 29 additions and 0 deletions
29
src/components/modal/modal.vue
Normal file
29
src/components/modal/modal.vue
Normal file
|
@ -0,0 +1,29 @@
|
|||
<template>
|
||||
<div
|
||||
v-body-scroll-lock="true"
|
||||
@click.self="closeModal"
|
||||
class="modal-view"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
methods: {
|
||||
closeModal () {
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.modal-view {
|
||||
body:not(.scroll-locked) & {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
Loading…
Reference in a new issue