From 07ec18fe11a347f8cbad6b3e667dfc9d9f09c867 Mon Sep 17 00:00:00 2001
From: taehoon <th.dev91@gmail.com>
Date: Fri, 18 Oct 2019 07:04:24 -0400
Subject: add reusable modal component

---
 src/components/modal/modal.vue | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 src/components/modal/modal.vue

(limited to 'src/components/modal/modal.vue')

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>
-- 
cgit v1.2.3-70-g09d2

