aboutsummaryrefslogtreecommitdiff
path: root/src/components/modal/modal.js
blob: 36cd7f4a37f21d4549f45c7b17700a7516d28f19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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