aboutsummaryrefslogtreecommitdiff
path: root/src/components/modal/modal.vue
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-10-18 07:04:24 -0400
committertaehoon <th.dev91@gmail.com>2019-10-18 07:04:24 -0400
commit07ec18fe11a347f8cbad6b3e667dfc9d9f09c867 (patch)
tree89d6b600f9b50d8c6cc83545e4ce4f8ddf01a1c5 /src/components/modal/modal.vue
parent093d785fbf8c982421f0098ad4b48c9d96b85ee8 (diff)
add reusable modal component
Diffstat (limited to 'src/components/modal/modal.vue')
-rw-r--r--src/components/modal/modal.vue29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue
new file mode 100644
index 00000000..389a8881
--- /dev/null
+++ b/src/components/modal/modal.vue
@@ -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>