diff options
| author | taehoon <th.dev91@gmail.com> | 2019-02-07 03:05:59 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-02-15 13:34:33 -0500 |
| commit | 13725f040bca346a7b35b832f36f4e86c5da11e4 (patch) | |
| tree | aafd73aa352b6f2e52b968d1e2e79cb225cdc0d6 /src/components/modal/modal.js | |
| parent | 4f95371081fd54291e3d81d7e254e9cfa1bd5b82 (diff) | |
Add avatar crop popup
Diffstat (limited to 'src/components/modal/modal.js')
| -rw-r--r-- | src/components/modal/modal.js | 17 |
1 files changed, 17 insertions, 0 deletions
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 |
