From 13725f040bca346a7b35b832f36f4e86c5da11e4 Mon Sep 17 00:00:00 2001 From: taehoon Date: Thu, 7 Feb 2019 03:05:59 -0500 Subject: Add avatar crop popup --- src/components/modal/modal.js | 17 +++++++ src/components/modal/modal.vue | 101 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 src/components/modal/modal.js create mode 100644 src/components/modal/modal.vue (limited to 'src/components/modal') diff --git a/src/components/modal/modal.js b/src/components/modal/modal.js new file mode 100644 index 00000000..36cd7f4a --- /dev/null +++ b/src/components/modal/modal.js @@ -0,0 +1,17 @@ +const Modal = { + props: ['show', 'title'], + methods: { + close: function () { + this.$emit('close') + } + }, + mounted: function () { + document.addEventListener('keydown', (e) => { + if (this.show && e.keyCode === 27) { + this.close() + } + }) + } +} + +export default Modal diff --git a/src/components/modal/modal.vue b/src/components/modal/modal.vue new file mode 100644 index 00000000..2e3cbe75 --- /dev/null +++ b/src/components/modal/modal.vue @@ -0,0 +1,101 @@ + + + + + -- cgit v1.2.3-70-g09d2