diff options
| author | taehoon <th.dev91@gmail.com> | 2019-10-18 07:04:24 -0400 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-10-18 07:04:24 -0400 |
| commit | 07ec18fe11a347f8cbad6b3e667dfc9d9f09c867 (patch) | |
| tree | 89d6b600f9b50d8c6cc83545e4ce4f8ddf01a1c5 /src/components/modal | |
| parent | 093d785fbf8c982421f0098ad4b48c9d96b85ee8 (diff) | |
add reusable modal component
Diffstat (limited to 'src/components/modal')
| -rw-r--r-- | src/components/modal/modal.vue | 29 |
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> |
